[clang-tools-extra] [clangd] Use TargetOpts from preamble when building ASTs (PR #88381)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 11 07:23:26 PDT 2024


================
@@ -451,6 +451,7 @@ ParsedAST::build(llvm::StringRef Filename, const ParseInputs &Inputs,
   DiagnosticConsumer *DiagConsumer = &ASTDiags;
   IgnoreDiagnostics DropDiags;
   if (Preamble) {
+    CI->TargetOpts = Preamble->TargetOpts;
     Patch = PreamblePatch::createFullPatch(Filename, Inputs, *Preamble);
----------------
ilya-biryukov wrote:

Idea: should we make this part of `PreamblePatch`?
It seems to fit the concept (take inputs from preamble, patch up compiler invocation based on it). Although I'm not sure if I'm misreading its intention.

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


More information about the cfe-commits mailing list