chandlerc wrote:

> You might want to change the `DisableFree` default for library uses so that 
> users don't need to specify `-no-disable-free`.
> 
> ```
>   // Clang calls BuryPointer on the internal AST and CodeGen-related elements 
> like TargetMachine.
>   // This will cause memory leaks if `compile` is executed many times.
>   ci->getCodeGenOpts().DisableFree = false;
>   ci->getFrontendOpts().DisableFree = false;
> ```

Not really sure what default change you're thinking about?

The default that was causing me problems was the driver adding `-disable-free` 
to the CC1 flags by default -- but I think that's probably the *correct* 
default. I just wanted a way to override it in a library where the behavior 
would be problematic. Having the flag support appending `-no-disable-free` to 
the CC1 flags seemed like the cleanest solution that keeps the best defaults 
for the most common cases, but gives a path to handle the case of CC1 flags. 
Does that make sense?

https://github.com/llvm/llvm-project/pull/136213
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to