new is not a valid default anywhere, so make this pure virtual
authorAndrew Lenharth <andrewl@lenharth.org>
Thu, 28 Jul 2005 18:13:59 +0000 (18:13 +0000)
committerAndrew Lenharth <andrewl@lenharth.org>
Thu, 28 Jul 2005 18:13:59 +0000 (18:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22542 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineCodeEmitter.h
lib/CodeGen/ELFWriter.cpp
lib/CodeGen/MachineCodeEmitter.cpp

index 59c5b614afe5678dc8af53ae14325e9e42f1ac1b..f5ee2e62371cfa19f2bb2a8b08c13f9579bd30f1 100644 (file)
@@ -94,11 +94,8 @@ public:
   //
   virtual uint64_t getConstantPoolEntryAddress(unsigned Index) = 0;
 
-  // allocateGlobal - Allocate some space for a global variable.  This is
-  // used by the JIT to allocate space in the global variable region.
-  virtual unsigned char* allocateGlobal(unsigned size, unsigned alignment) {
-    return new unsigned char[(size_t)size];
-  }
+  // allocateGlobal - Allocate some space for a global variable.
+  virtual unsigned char* allocateGlobal(unsigned size, unsigned alignment) = 0;
 
   /// createDebugEmitter - Return a dynamically allocated machine
   /// code emitter, which just prints the opcodes and fields out the cout.  This
index 7963b658d6685a6b9129945be463d5079b925569..cdbc13a20f19011ecc8613939244bba4f5a6dd11 100644 (file)
@@ -85,6 +85,11 @@ namespace llvm {
       return 0;
     }
 
+    virtual unsigned char* allocateGlobal(unsigned size, unsigned alignment) {
+      assert(0 && "Globals not implemented yet!");
+      return 0;
+    }
+
     /// JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE!
     void startFunctionStub(unsigned StubSize) {
       assert(0 && "JIT specific function called!");
index 3037cba297335576db669cee976f4abe1d4eae39..1090d762d7ed182c6e06beeeb17aa2e37a0c4826 100644 (file)
@@ -51,6 +51,9 @@ namespace {
       std::cout << "<relocation> ";
     }
 
+    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; }
@@ -142,6 +145,10 @@ namespace {
     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();
     }