[clang] [llvm] [AIX][TOC] Add -mtocdata/-mno-tocdata options on AIX (PR #67999)

Zaara Syeda via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 29 08:41:17 PST 2023


================
@@ -622,6 +622,28 @@ static bool checkAliasedGlobal(
   return true;
 }
 
+// Emit a warning if toc-data attribute is requested for global variables that
+// have aliases and remove the toc-data attribute.
+static void checkAliasForTocData(llvm::GlobalVariable *GVar,
+                                 const CodeGenOptions &CodeGenOpts,
+                                 DiagnosticsEngine &Diags,
+                                 SourceLocation Location) {
+  if (GVar->hasAttribute("toc-data")) {
+    auto GVId = GVar->getGlobalIdentifier();
----------------
syzaara wrote:

When we support the local linkage variables for toc-data, it will be for the option -mtocdata which enables toc-data across the board. The list option -mtocdata= is only for variables with external linkage specified using their mangled name. So there shouldn't be an issue with searching for the name of variables with local linkage.

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


More information about the cfe-commits mailing list