================
@@ -15452,6 +15520,13 @@ void Sema::FinalizeDeclaration(Decl *ThisDecl) {
     }
   }
 
+  // Validate variables named in '-mloadtime-comment-vars=': supported string
+  // variables get an implicit attribute that CodeGen uses to preserve them;
+  // named variables that cannot be preserved are diagnosed.
+  if (!getLangOpts().LoadTimeCommentVars.empty() && !VD->isInvalidDecl() &&
+      Context.getTargetInfo().getTriple().isOSAIX())
----------------
tonykuttai wrote:

As per our offline discussion, implemented the following: the driver keeps the 
warning-and-drop behavior, and cc1 now rejects the option on non-AIX targets 
with an error (`err_drv_unsupported_opt_for_target` similar to 
`-mabi=quadword-atomics` and `-mxcoff-roptr checks`). With `cc1` enforcing the 
target, the Sema-side AIX check originally flagged is indeed implied by the 
option list being non-empty, and is removed. This closes the `-Xclang 
-mloadtime-comment-vars=` path on non-AIX drivers, which previously was a 
silent no-op.

https://github.com/llvm/llvm-project/pull/187986
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to