LinearScanner hotspot.
[oota-llvm.git] / lib / CodeGen / ELFWriter.cpp
index 69302a3605d6742d4ddae6c0af629704e34d15e4..4f041c27375866b7f43b9f65962da84db9cc3f89 100644 (file)
@@ -35,6 +35,7 @@
 #include "llvm/Module.h"
 #include "llvm/CodeGen/MachineCodeEmitter.h"
 #include "llvm/CodeGen/MachineConstantPool.h"
+#include "llvm/Target/TargetData.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Support/Mangler.h"
 #include <iostream>
@@ -61,21 +62,24 @@ namespace llvm {
     void addRelocation(const MachineRelocation &MR) {
       assert(0 && "relo not handled yet!");
     }
-    virtual uint64_t getConstantPoolEntryAddress(unsigned Index) {
+    
+    virtual void StartMachineBasicBlock(MachineBasicBlock *MBB) {
+    }
+
+    virtual intptr_t getConstantPoolEntryAddress(unsigned Index) const {
       assert(0 && "CP not implementated yet!");
       return 0;
     }
-    virtual uint64_t getJumpTableEntryAddress(unsigned Index) {
+    virtual intptr_t getJumpTableEntryAddress(unsigned Index) const {
       assert(0 && "JT not implementated yet!");
       return 0;
     }
-    
-    virtual void emitJumpTableInfo(MachineJumpTableInfo *MJTI,
-                                   std::map<MachineBasicBlock*,uint64_t> &MBBM){
+
+    virtual intptr_t getMachineBasicBlockAddress(MachineBasicBlock *MBB) const {
       assert(0 && "JT not implementated yet!");
+      return 0;
     }
 
-
     /// JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE!
     void startFunctionStub(unsigned StubSize) {
       assert(0 && "JIT specific function called!");
@@ -158,8 +162,8 @@ ELFWriter::ELFWriter(std::ostream &o, TargetMachine &tm) : O(o), TM(tm) {
   e_machine = 0;  // e_machine defaults to 'No Machine'
   e_flags = 0;    // e_flags defaults to 0, no flags.
 
-  is64Bit = TM.getTargetData().getPointerSizeInBits() == 64;
-  isLittleEndian = TM.getTargetData().isLittleEndian();
+  is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
+  isLittleEndian = TM.getTargetData()->isLittleEndian();
 
   // Create the machine code emitter object for this target.
   MCE = new ELFCodeEmitter(*this);
@@ -233,8 +237,8 @@ void ELFWriter::EmitGlobal(GlobalVariable *GV) {
   }
 
   const Type *GVType = (const Type*)GV->getType();
-  unsigned Align = TM.getTargetData().getTypeAlignment(GVType);
-  unsigned Size  = TM.getTargetData().getTypeSize(GVType);
+  unsigned Align = TM.getTargetData()->getTypeAlignment(GVType);
+  unsigned Size  = TM.getTargetData()->getTypeSize(GVType);
 
   // If this global has a zero initializer, it is part of the .bss or common
   // section.