[clang] [llvm] [Clang][AIX] Add -mloadtime-comment-vars flag to preserve identifying variables (PR #187986)
Wael Yehia via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 19 10:00:38 PDT 2026
================
@@ -1077,6 +1077,13 @@ void CodeGenModule::Release() {
Module *Primary = getContext().getCurrentNamedModule();
if (CXX20ModuleInits && Primary && !Primary->isHeaderLikeModule())
EmitModuleInitializers(Primary);
----------------
w2yehia wrote:
Also, specifying variable names in a list for C++ programs is not straightforward. I would prefer to use mangled names, then you don't have to worry about things like:
```
> cat t.cpp
namespace { int x; }
int x;
namespace N { int x; }
class A { static int x; }
# will you need to use :: operator like so?
> clang -mloadtime-comment-vars="x,::x,N::x,A::x"
```
You either accept mangled names or put restrictions on what kind of global variables can be listed via the option.
@hubert-reinterpretcast if you have any comments/suggestions?
https://github.com/llvm/llvm-project/pull/187986
More information about the llvm-commits
mailing list