[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineCodeEmitter.h

Andrew Lenharth alenhar2 at cs.uiuc.edu
Thu Jul 28 05:44:25 PDT 2005



Changes in directory llvm/include/llvm/CodeGen:

MachineCodeEmitter.h updated: 1.26 -> 1.27
---
Log message:

Like constants, globals on some platforms are GOT relative.  This means they have to be allocated
near the GOT, which new doesn't do.  So break out the allocate into a new function.

Also move GOT index handling into JITResolver.  This lets it update the mapping when a Lazy
function is JITed.  It doesn't managed the table, just the mapping.  Note that this is
still non-ideal, as any function that takes a function address should also take a GOT
index, but that is a lot of changes.  The relocation resolve process updates any GOT entry
it sees is out of date.



---
Diffs of the changes:  (+6 -0)

 MachineCodeEmitter.h |    6 ++++++
 1 files changed, 6 insertions(+)


Index: llvm/include/llvm/CodeGen/MachineCodeEmitter.h
diff -u llvm/include/llvm/CodeGen/MachineCodeEmitter.h:1.26 llvm/include/llvm/CodeGen/MachineCodeEmitter.h:1.27
--- llvm/include/llvm/CodeGen/MachineCodeEmitter.h:1.26	Thu Apr 21 15:38:00 2005
+++ llvm/include/llvm/CodeGen/MachineCodeEmitter.h	Thu Jul 28 07:44:13 2005
@@ -94,6 +94,12 @@
   //
   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];
+  }
+
   /// createDebugEmitter - Return a dynamically allocated machine
   /// code emitter, which just prints the opcodes and fields out the cout.  This
   /// can be used for debugging users of the MachineCodeEmitter interface.






More information about the llvm-commits mailing list