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

Hubert Tong via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 5 15:51:55 PDT 2026


================
@@ -15532,6 +15532,12 @@ static void processForLoadTimeCommentVar(Sema &S, VarDecl *VD) {
     Reason = diag::LoadTimeCommentVarReason::TemplateSpecialization;
   else if (VD->isStaticDataMember())
     Reason = diag::LoadTimeCommentVarReason::StaticDataMember;
+  else if (VD->isInline())
+    // An inline variable is defined in every translation unit that sees it,
+    // and a module importer re-emits it using the decision made when the
+    // module was built, so the result would depend on option consistency
+    // across compilations.
----------------
hubert-reinterpretcast wrote:

The more important point is that, regardless of modules, an `inline` variable does not have a strong relationship to any particular translation unit. This weak binding is especially noticeable in the context of header units.

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


More information about the cfe-commits mailing list