Make load->store deletion a bit smarter. This allows us to compile this:
[oota-llvm.git] / lib / CodeGen / ELFWriter.cpp
index 9ca7cf14c236aeab24f3bbdb7742a328a087bc6f..3074e31edde69eb7776090fa9e5ecd6259fc1971 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by Chris Lattner and is distributed under the
-// University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -47,7 +47,7 @@
 #include <list>
 using namespace llvm;
 
-const char ELFWriter::ID = 0;
+char ELFWriter::ID = 0;
 /// AddELFWriter - Concrete function to add the ELF writer to the function pass
 /// manager.
 MachineCodeEmitter *llvm::AddELFWriter(FunctionPassManager &FPM,
@@ -72,7 +72,7 @@ namespace llvm {
     std::vector<unsigned char> *OutBuffer;
     size_t FnStart;
   public:
-    ELFCodeEmitter(ELFWriter &ew) : EW(ew), TM(EW.TM), OutBuffer(0) {}
+    explicit ELFCodeEmitter(ELFWriter &ew) : EW(ew), TM(EW.TM), OutBuffer(0) {}
 
     void startFunction(MachineFunction &F);
     bool finishFunction(MachineFunction &F);
@@ -258,7 +258,7 @@ void ELFWriter::EmitGlobal(GlobalVariable *GV) {
 
   const Type *GVType = (const Type*)GV->getType();
   unsigned Align = TM.getTargetData()->getPrefTypeAlignment(GVType);
-  unsigned Size  = TM.getTargetData()->getTypeSize(GVType);
+  unsigned Size  = TM.getTargetData()->getABITypeSize(GVType);
 
   // If this global has a zero initializer, it is part of the .bss or common
   // section.