#include "llvm/Support/OutputBuffer.h"
#include "llvm/Support/Streams.h"
#include <algorithm>
+#include <cstring>
using namespace llvm;
/// AddMachOWriter - Concrete function to add the Mach-O writer to the function
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!");
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.