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

Chris Lattner lattner at cs.uiuc.edu
Tue May 2 16:22:40 PDT 2006



Changes in directory llvm/include/llvm/CodeGen:

MachineCodeEmitter.h updated: 1.36 -> 1.37
---
Log message:

Several related changes:

1. Change several methods in the MachineCodeEmitter class to be pure virtual.
2. Suck emitConstantPool/initJumpTableInfo into startFunction, removing them
   from the MachineCodeEmitter interface, and reducing the amount of target-
   specific code.
3. Change the JITEmitter so that it allocates constantpools and jump tables
   *right* next to the functions that they belong to, instead of in a separate
   pool of memory.  This makes all memory for a function be contiguous, and
   means the JITEmitter only tracks one block of memory now.



---
Diffs of the changes:  (+5 -15)

 MachineCodeEmitter.h |   20 +++++---------------
 1 files changed, 5 insertions(+), 15 deletions(-)


Index: llvm/include/llvm/CodeGen/MachineCodeEmitter.h
diff -u llvm/include/llvm/CodeGen/MachineCodeEmitter.h:1.36 llvm/include/llvm/CodeGen/MachineCodeEmitter.h:1.37
--- llvm/include/llvm/CodeGen/MachineCodeEmitter.h:1.36	Tue May  2 17:51:03 2006
+++ llvm/include/llvm/CodeGen/MachineCodeEmitter.h	Tue May  2 18:22:24 2006
@@ -65,31 +65,21 @@
   /// about to be code generated.  This initializes the BufferBegin/End/Ptr
   /// fields.
   ///
-  virtual void startFunction(MachineFunction &F) {}
+  virtual void startFunction(MachineFunction &F) = 0;
 
   /// finishFunction - This callback is invoked when the specified function has
   /// finished code generation.  If a buffer overflow has occurred, this method
   /// returns true (the callee is required to try again), otherwise it returns
   /// false.
   ///
-  virtual bool finishFunction(MachineFunction &F) {
-    return CurBufferPtr == BufferEnd;
-  }
-
-  /// emitConstantPool - This callback is invoked to output the constant pool
-  /// for the function.
-  virtual void emitConstantPool(MachineConstantPool *MCP) {}
-
-  /// initJumpTableInfo - This callback is invoked by the JIT to allocate the
-  /// necessary memory to hold the jump tables.
-  virtual void initJumpTableInfo(MachineJumpTableInfo *MJTI) {}
+  virtual bool finishFunction(MachineFunction &F) = 0;
   
   /// emitJumpTableInfo - This callback is invoked to output the jump tables
   /// for the function.  In addition to a pointer to the MachineJumpTableInfo,
   /// this function also takes a map of MBBs to addresses, so that the final
   /// addresses of the MBBs can be written to the jump tables.
   virtual void emitJumpTableInfo(MachineJumpTableInfo *MJTI,
-                                 std::map<MachineBasicBlock*,uint64_t> &MBBM) {}
+                              std::map<MachineBasicBlock*,uint64_t> &MBBM) = 0;
   
   /// startFunctionStub - This callback is invoked when the JIT needs the
   /// address of a function that has not been code generated yet.  The StubSize
@@ -97,12 +87,12 @@
   /// have constant pools, the can only use the other emitByte*/emitWord*
   /// methods.
   ///
-  virtual void startFunctionStub(unsigned StubSize) {}
+  virtual void startFunctionStub(unsigned StubSize) = 0;
 
   /// finishFunctionStub - This callback is invoked to terminate a function
   /// stub.
   ///
-  virtual void *finishFunctionStub(const Function *F) { return 0; }
+  virtual void *finishFunctionStub(const Function *F) = 0;
 
   /// emitByte - This callback is invoked when a byte needs to be written to the
   /// output stream.






More information about the llvm-commits mailing list