[llvm-commits] [llvm] r61630 - /llvm/trunk/lib/CodeGen/ELFWriter.cpp

Chris Lattner sabre at nondot.org
Sun Jan 4 12:19:20 PST 2009


Author: lattner
Date: Sun Jan  4 14:19:20 2009
New Revision: 61630

URL: http://llvm.org/viewvc/llvm-project?rev=61630&view=rev
Log:
elf writer really wants the size of the global, not the size 
of the pointer to the global.

Modified:
    llvm/trunk/lib/CodeGen/ELFWriter.cpp

Modified: llvm/trunk/lib/CodeGen/ELFWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.cpp?rev=61630&r1=61629&r2=61630&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/ELFWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/ELFWriter.cpp Sun Jan  4 14:19:20 2009
@@ -34,7 +34,7 @@
 #include "ELFWriter.h"
 #include "llvm/Module.h"
 #include "llvm/PassManager.h"
-#include "llvm/Type.h"          // FIXME: For PATypeHolder::get().
+#include "llvm/DerivedTypes.h"
 #include "llvm/CodeGen/FileWriters.h"
 #include "llvm/CodeGen/MachineCodeEmitter.h"
 #include "llvm/CodeGen/MachineConstantPool.h"
@@ -274,9 +274,9 @@
     return;
   }
 
-  const Type *GVType = (const Type*)GV->getType();
   unsigned Align = TM.getTargetData()->getPreferredAlignment(GV);
-  unsigned Size  = TM.getTargetData()->getABITypeSize(GVType);
+  unsigned Size  =
+    TM.getTargetData()->getABITypeSize(GV->getType()->getElementType());
 
   // If this global has a zero initializer, it is part of the .bss or common
   // section.





More information about the llvm-commits mailing list