[PATCH] D10837: Make global aliases have symbol size equal to their type

David Blaikie dblaikie at gmail.com
Tue Jul 14 10:24:22 PDT 2015


dblaikie added inline comments.

================
Comment at: lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1117
@@ +1116,3 @@
+      const DataLayout &DL = M.getDataLayout();
+      uint64_t Size = DL.getTypeAllocSize(Alias.getType()->getElementType());
+      OutStreamer->emitELFSize(cast<MCSymbolELF>(Name),
----------------
Yeah, this would be a problem for the typeless pointer work. If you can avoid introducing calls to PointerType::getElementType it'll make my migration work a bit easier.

Chances are, what we need, is GlobalValue to have a value type (I think I've added this to GlobalVariable or some other things in the GlobalValue hierarchy - if all of them need it, we can just add it up in GlobalValue) that can be retrieved directly, because their actual type will eventually just be an opaque pointer.

I don't know much about aliases - they can be differently typed than the thing they alias? Not sure what that means or what their size means either... 


Repository:
  rL LLVM

http://reviews.llvm.org/D10837







More information about the llvm-commits mailing list