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

Tony Varghese via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 27 23:08:16 PDT 2026


================
@@ -6401,6 +6401,16 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
   else if (UnwindTables)
      CmdArgs.push_back("-funwind-tables=1");
 
+  // Forward the loadtime-comment vars option to cc1 only on targets that
+  // support it.
+  if (Arg *A = Args.getLastArg(options::OPT_mloadtime_comment_vars_EQ)) {
+    if (Triple.isOSAIX())
+      A->render(Args, CmdArgs);
----------------
tonykuttai wrote:

it was not intended. `cc1` marshalled the option as a string vector, so repeated occurrence already append, but driver only forwarded the last one. Corrected the driver behaviour to forward every occurrence of the option, so both cc1 and driver combine the option lists. Tests added at both levels to lock this behaviour. At driver level both occurrences reach cc1 in order and during CodeGen: the cc1 option given twice preserves both variables. Docs updated.

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


More information about the llvm-commits mailing list