remove hack
[oota-llvm.git] / lib / CodeGen / MachineCodeEmitter.cpp
index c64366cded07ca0e41fb0c51fbde8075b0fcbbee..1090d762d7ed182c6e06beeeb17aa2e37a0c4826 100644 (file)
@@ -1,10 +1,10 @@
 //===-- MachineCodeEmitter.cpp - Implement the MachineCodeEmitter itf -----===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This file implements the MachineCodeEmitter interface.
@@ -35,7 +35,7 @@ namespace {
       std::cout << "\n--- End of stub for Function\n";
       return 0;
     }
-    
+
     void emitByte(unsigned char B) {
       std::cout << "0x" << std::hex << (unsigned int)B << std::dec << " ";
     }
@@ -51,20 +51,12 @@ namespace {
       std::cout << "<relocation> ";
     }
 
-    uint64_t getGlobalValueAddress(GlobalValue *V) { return 0; }
-    uint64_t getGlobalValueAddress(const char *Name) { return 0; }
+    virtual unsigned char* allocateGlobal(unsigned size, unsigned alignment)
+    { return 0; }
+
     uint64_t getConstantPoolEntryAddress(unsigned Num) { return 0; }
     uint64_t getCurrentPCValue() { return 0; }
     uint64_t getCurrentPCOffset() { return 0; }
-
-    // forceCompilationOf - Force the compilation of the specified function, and
-    // return its address, because we REALLY need the address now.
-    //
-    // FIXME: This is JIT specific!
-    //
-    virtual uint64_t forceCompilationOf(Function *F) {
-      return 0;
-    }
   };
 
   class FilePrinterEmitter : public MachineCodeEmitter {
@@ -73,14 +65,14 @@ namespace {
     MachineCodeEmitter &MCE;
     unsigned counter;
     unsigned values[4];
-    
+
   public:
     FilePrinterEmitter(MachineCodeEmitter &M, std::ostream &os)
       : o(os), MCE(M), counter(0) {
       openActual();
     }
-    
-    ~FilePrinterEmitter() { 
+
+    ~FilePrinterEmitter() {
       o << "\n";
       actual.close();
     }
@@ -112,7 +104,7 @@ namespace {
     void *finishFunctionStub(const Function *F) {
       return MCE.finishFunctionStub(F);
     }
-    
+
     void emitByte(unsigned char B) {
       MCE.emitByte(B);
       actual << B; actual.flush();
@@ -150,15 +142,13 @@ namespace {
     void emitWordAt(unsigned W, unsigned *Ptr) {
       MCE.emitWordAt(W, Ptr);
     }
-    uint64_t getGlobalValueAddress(GlobalValue *V) {
-      return MCE.getGlobalValueAddress(V);
-    }
-    uint64_t getGlobalValueAddress(const char *Name) {
-      return MCE.getGlobalValueAddress(Name);
-    }
     uint64_t getConstantPoolEntryAddress(unsigned Num) {
       return MCE.getConstantPoolEntryAddress(Num);
     }
+
+    virtual unsigned char* allocateGlobal(unsigned size, unsigned alignment)
+    { return MCE.allocateGlobal(size, alignment); }
+
     uint64_t getCurrentPCValue() {
       return MCE.getCurrentPCValue();
     }
@@ -168,15 +158,6 @@ namespace {
     void addRelocation(const MachineRelocation &MR) {
       return MCE.addRelocation(MR);
     }
-
-    // forceCompilationOf - Force the compilation of the specified function, and
-    // return its address, because we REALLY need the address now.
-    //
-    // FIXME: This is JIT specific!
-    //
-    virtual uint64_t forceCompilationOf(Function *F) {
-      return MCE.forceCompilationOf(F);
-    }
   };
 }