More constification of things. More comments added. No functionality
[oota-llvm.git] / lib / CodeGen / MachOWriter.cpp
index 56bf70a62ae44ab99e3184f1219e07fef1f470d8..92b3eb4311c348c4b72115baaf5aa827446236a6 100644 (file)
@@ -125,6 +125,20 @@ namespace llvm {
       return MBBLocations[MBB->getNumber()];
     }
 
+    virtual intptr_t getLabelAddress(uint64_t Label) const {
+      assert(0 && "get Label not implemented");
+      abort();
+      return 0;
+    }
+
+    virtual void emitLabel(uint64_t LabelID) {
+      assert(0 && "emit Label not implemented");
+      abort();
+    }
+
+
+    virtual void setModuleInfo(llvm::MachineModuleInfo* MMI) { }
+
     /// JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE!
     virtual void startFunctionStub(unsigned StubSize, unsigned Alignment = 1) {
       assert(0 && "JIT specific function called!");
@@ -334,10 +348,8 @@ MachOWriter::~MachOWriter() {
 void MachOWriter::AddSymbolToSection(MachOSection *Sec, GlobalVariable *GV) {
   const Type *Ty = GV->getType()->getElementType();
   unsigned Size = TM.getTargetData()->getABITypeSize(Ty);
-  unsigned Align = GV->getAlignment();
-  if (Align == 0)
-    Align = TM.getTargetData()->getPrefTypeAlignment(Ty);
-  
+  unsigned Align = TM.getTargetData()->getPreferredAlignment(GV);
+
   // Reserve space in the .bss section for this symbol while maintaining the
   // desired section alignment, which must be at least as much as required by
   // this symbol.