mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-16 22:58:12 +00:00
Sadly, the Clang driver unconditionally injects the `-disable-free` flag to CC1 invocations. =/ This ends up with us leaking memory when invoking Clang programmatically, for example in unit tests. I've fixed this by post-processing the flags. The alternatives I see all involve duplicating even more code from within Clang's internals into our runner, and we already have a lot of that. I have left a TODO to try and follow up with upstream about fixing this in a more sustainable way, but wanted to get the testing in place anyways. I've also threaded a flag through the various layers so that when we're on the command line we can actually skip this and get the same compile time benefits that Clang itself gets from disabling freeing all of the internal data structures. --------- Co-authored-by: Jon Ross-Perkins <jperkins@google.com>