[PATCH] D15215: Emit function alias to data as a function symbol

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 3 16:16:30 PST 2015


eugenis added inline comments.

================
Comment at: lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1192
@@ +1191,3 @@
+    // explicitly switch the symbol type to function.
+    if (Alias.getType()->isPointerTy() &&
+        Alias.getType()->getPointerElementType()->isFunctionTy() &&
----------------
pcc wrote:
> This will always be true (`GlobalValue::getType` returns a `PointerType *`).
Good point. Removed.

================
Comment at: lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1194
@@ +1193,3 @@
+        Alias.getType()->getPointerElementType()->isFunctionTy() &&
+        !isa<Function>(Alias.getAliasee()))
+      OutStreamer->EmitSymbolAttribute(Name, MCSA_ELF_TypeFunction);
----------------
pcc wrote:
> Is this check needed?
It's not strictly necessary, but without it, we would insert extra
  .type alias, at function
(in .S output) when the aliasee is already a function.



Repository:
  rL LLVM

http://reviews.llvm.org/D15215





More information about the llvm-commits mailing list