[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
================
@@ -0,0 +1,291 @@
+// Test -mloadtime-comment-vars= IR output for C++ on AIX. Four scenarios
+// are covered, each with its own set of named variables and check prefix:
+//
+// CHECK — mangled-name matching: file- and namespace-scope variables
+// receive !loadtime_comment metadata and are added to
+// llvm.compiler.used; name-matched static data members are
+// diagnosed and left unpreserved (still emitted as ordinary
+// definitions). A second pass (NOEMIT) over the same output
+// proves that listed variables of non-plain-char element type
+// (wchar_t, char16_t, char8_t) and of non-character type are
+// not preserved and not emitted. Their diagnostic is covered
+// by the Sema tests and silenced here.
+//
+// STORAGE — storage-duration filtering: thread_local variables are
+// diagnosed by Sema and receive no metadata; a function-local
+// static is diagnosed and receives no metadata.
+//
+// SPACE/DUP — list-parsing edge cases: a name with a leading space matches
+// nothing; a duplicate name preserves the variable exactly once.
----------------
hubert-reinterpretcast wrote:
@tonykuttai, this file is rather large as it is. I'm going to wait for this to be addressed before completing my review of this file.
https://github.com/llvm/llvm-project/pull/187986
More information about the cfe-commits
mailing list