[PATCH] D137441: [IR] Allow available_externally GlobalAlias

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 6 09:26:27 PST 2022


nikic added a comment.

Looks reasonable to me.



================
Comment at: llvm/docs/LangRef.rst:912
+  ``available_externally`` global value; otherwise the aliasee can be an
+  expression but not global value in the expression can be a declaration, since
+  that would require a relocation, which is not possible.
----------------
not -> no?


================
Comment at: llvm/lib/IR/Verifier.cpp:826
+  if (const auto *GV = dyn_cast<GlobalValue>(&C)) {
+    Check(GA.hasAvailableExternallyLinkage() || !GV->isDeclarationForLinker(),
+          "Alias must point to a definition", &GA);
----------------
I think it would be slightly more elegant to put this into an `else` branch rather than check for available_externally again here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137441/new/

https://reviews.llvm.org/D137441



More information about the llvm-commits mailing list