diff options
author | Chris Lattner <sabre@nondot.org> | 2006-05-02 23:22:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-05-02 23:22:24 +0000 |
commit | f75f9be3fb89eb6661a0ed8bfee8a6328ee5a4d1 (patch) | |
tree | 763c4953dc25b80928238b6ce38e918a2c4366c8 /include/llvm/CodeGen/MachineCodeEmitter.h | |
parent | 1f4549f35c69376a07360bd57ff06ed8f636d153 (diff) | |
download | external_llvm-f75f9be3fb89eb6661a0ed8bfee8a6328ee5a4d1.tar.gz external_llvm-f75f9be3fb89eb6661a0ed8bfee8a6328ee5a4d1.tar.bz2 external_llvm-f75f9be3fb89eb6661a0ed8bfee8a6328ee5a4d1.zip |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28065 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineCodeEmitter.h')
-rw-r--r-- | include/llvm/CodeGen/MachineCodeEmitter.h | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/include/llvm/CodeGen/MachineCodeEmitter.h b/include/llvm/CodeGen/MachineCodeEmitter.h index d26d7e773f..f63d6ed0f4 100644 --- a/include/llvm/CodeGen/MachineCodeEmitter.h +++ b/include/llvm/CodeGen/MachineCodeEmitter.h @@ -65,31 +65,21 @@ public: /// 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 @@ public: /// 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. |