[clang] [Clang] ASTUnit should use the CompilerInstance's CodeGenOptions (PR #195338)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon May 4 09:50:15 PDT 2026


================
@@ -1679,6 +1679,7 @@ std::unique_ptr<ASTUnit> ASTUnit::LoadFromCompilerInvocation(
   // Create the AST unit.
   std::unique_ptr<ASTUnit> AST(new ASTUnit(false));
   ConfigureDiags(Diags, *AST, CaptureDiagnostics);
+  *AST->CodeGenOpts = CI->getCodeGenOpts();
----------------
AaronBallman wrote:

It's a little bit weird to me that we pass in `DiagOpts` and `Diags` but then pull only the codegen options from the compiler invocation. What about things like `TargetOpts`, `HSOpts`, `PPOpts`, etc?

https://github.com/llvm/llvm-project/pull/195338


More information about the cfe-commits mailing list