summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/ELFWriter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-04 20:19:20 +0000
committerChris Lattner <sabre@nondot.org>2009-01-04 20:19:20 +0000
commit8f561c9c972d59095d8bb832b324d40db356c74b (patch)
tree6ce43d70bf9202edd72ffd42416d151a39f20a1f /llvm/lib/CodeGen/ELFWriter.cpp
parentbe631a3cd1d97080d29456b11435c392848cb3ce (diff)
downloadbcm5719-llvm-8f561c9c972d59095d8bb832b324d40db356c74b.tar.gz
bcm5719-llvm-8f561c9c972d59095d8bb832b324d40db356c74b.zip
elf writer really wants the size of the global, not the size
of the pointer to the global. llvm-svn: 61630
Diffstat (limited to 'llvm/lib/CodeGen/ELFWriter.cpp')
-rw-r--r--llvm/lib/CodeGen/ELFWriter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/ELFWriter.cpp b/llvm/lib/CodeGen/ELFWriter.cpp
index 683a21e5e49..f0da37aca36 100644
--- a/llvm/lib/CodeGen/ELFWriter.cpp
+++ b/llvm/lib/CodeGen/ELFWriter.cpp
@@ -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 @@ void ELFWriter::EmitGlobal(GlobalVariable *GV) {
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.
OpenPOWER on IntegriCloud