Page MenuHomePhabricator

[clang][driver] Add option to manually control -disable-free in cc1
AbandonedPublic

Authored by Chenbing.Zheng on Mar 8 2023, 7:32 PM.

Details

Summary

I get a memory leak in clang's CompilerInstance::ExecuteAction,
and remove -disable-free in cc1 works according to
https://github.com/RadeonOpenCompute/ROCm-OpenCL-Driver/issues/13

So, I want to add option to manually control -disable-free in cc1.

Diff Detail

Unit TestsFailed

TimeTest
65,670 mslibcxx CI C++03 > llvm-libc++-shared-cfg-in.libcxx::transitive_includes.sh.cpp
Script: -- : 'RUN: at line 79'; mkdir /home/libcxx-builder/.buildkite-agent/builds/9dc98e39a602-1/llvm-project/libcxx-ci/build/generic-cxx03/test/libcxx/Output/transitive_includes.sh.cpp.dir/t.tmp
87,210 mslibcxx CI C++2b > llvm-libc++-shared-cfg-in.libcxx::transitive_includes.sh.cpp
Script: -- : 'RUN: at line 79'; mkdir /home/libcxx-builder/.buildkite-agent/builds/6e38f87b9152-1/llvm-project/libcxx-ci/build/generic-cxx2b/test/libcxx/Output/transitive_includes.sh.cpp.dir/t.tmp

Event Timeline

Chenbing.Zheng created this revision.Mar 8 2023, 7:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 8 2023, 7:32 PM
Chenbing.Zheng requested review of this revision.Mar 8 2023, 7:32 PM

Hmmm, can you explain a bit more about why you need this? By default, Clang (the application) leaks memory on shutdown (why free a whole bunch of memory only to terminate, which frees the memory for you?). So it surprises me that we'd need a *driver* option for this because the driver is how you execute clang itself (rather than using Clang as a library, which is why we have the cc1 option). So, to me, this doesn't feel strongly motivated, but I might be misunderstanding the problem you're trying to solve.

Chenbing.Zheng abandoned this revision.Apr 13 2023, 7:47 PM