[clang] [Clang] ASTUnit should use the CompilerInstance's CodeGenOptions (PR #195338)
via cfe-commits
cfe-commits at lists.llvm.org
Fri May 1 12:40:02 PDT 2026
Sirraide wrote:
Note: The `CodeGenOptions` stored in a `CompilerInstance` are a `std::shared_ptr`, the ones in the the `ASTUnit` a `std::unique_ptr`, so an alternative here would be to make both a `std::shared_ptr` and then expose the former as a `std::shared_ptr` (we currently only have a getter that returns a `CodeGenOptions&`) and then make both pointers to the same object.
Currently, `CompilerInstance` stores quite a bit of state behind `std::shared_ptr`s, but it doesn’t expose any of them as getters; I’m not sure if there is a reason for that, but I’ve opted for keeping these as two separate objects for now.
https://github.com/llvm/llvm-project/pull/195338
More information about the cfe-commits
mailing list