[clang] [llvm] [Clang][AIX] Add -mloadtime-comment-vars flag to preserve identifying variables (PR #187986)

Aaron Ballman via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 05:07:06 PDT 2026


================
@@ -6846,6 +6846,10 @@ void Sema::InstantiateVariableDefinition(SourceLocation PointOfInstantiation,
                                        OldVar->getPointOfInstantiation());
     // Emit any deferred warnings for the variable's initializer
     AnalysisWarnings.issueWarningsForRegisteredVarDecl(Var);
+    // Variables named in '-mloadtime-comment-vars=' are normally processed in
+    // FinalizeDeclaration, which instantiated definitions do not reach.
+    if (!getLangOpts().LoadTimeCommentVars.empty() && !Var->isInvalidDecl())
----------------
AaronBallman wrote:

When the predicate is moved into the helper function in SemaDecl.cpp, it can be removed from here too.

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


More information about the llvm-commits mailing list