This is an archive of the discontinued LLVM Phabricator instance.

[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

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