[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
Tue Jul 21 14:50:02 PDT 2026


================
@@ -15338,6 +15339,73 @@ void Sema::CheckThreadLocalForLargeAlignment(VarDecl *VD) {
   }
 }
 
+/// Process a variable definition whose mangled name may be listed in
+/// '-mloadtime-comment-vars=': attach an implicit attribute to supported
+/// string variables so CodeGen preserves them as loadtime identifying
+/// strings, and warn when a named variable cannot be preserved.
+static void checkLoadTimeCommentVar(Sema &S, VarDecl *VD) {
----------------
hubert-reinterpretcast wrote:

"Check" is the wrong verb here. It implies that this function only produces diagnostics and also implies that we are already dealing with a "loadtime comment variable".

Suggestion:
```suggestion
static void processForLoadTimeCommentVar(Sema &S, VarDecl *VD) {
```

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


More information about the cfe-commits mailing list