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

John Brawn john.brawn at arm.com
Wed Jul 15 05:03:17 PDT 2015


john.brawn 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),
----------------
dblaikie wrote:
> 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... 
It looks like you've added getValueType() to GlobalValue, which currently just returns getType()->getElementType() though I guess that will be changed sometime in the future. I'll use that instead.


Repository:
  rL LLVM

http://reviews.llvm.org/D10837







More information about the llvm-commits mailing list