* Add support for values in the constant pool

* Add support for functions referenced by name

llvm-svn: 5206
This commit is contained in:
Chris Lattner 2003-01-13 00:14:55 +00:00
parent 78133df9ac
commit 5d4b55f69f
1 changed files with 16 additions and 1 deletions

View File

@ -10,8 +10,10 @@
#ifndef LLVM_CODEGEN_MACHINE_CODE_EMITTER_H #ifndef LLVM_CODEGEN_MACHINE_CODE_EMITTER_H
#define LLVM_CODEGEN_MACHINE_CODE_EMITTER_H #define LLVM_CODEGEN_MACHINE_CODE_EMITTER_H
#include <string>
class MachineFunction; class MachineFunction;
class MachineBasicBlock; class MachineBasicBlock;
class MachineConstantPool;
class Value; class Value;
class GlobalValue; class GlobalValue;
@ -28,6 +30,10 @@ struct MachineCodeEmitter {
/// ///
virtual void finishFunction(MachineFunction &F) {} virtual void finishFunction(MachineFunction &F) {}
/// emitConstantPool - This callback is invoked to output the constant pool
/// for the function.
virtual void emitConstantPool(MachineConstantPool *MCP) {}
/// startBasicBlock - This callback is invoked when a new basic block is about /// startBasicBlock - This callback is invoked when a new basic block is about
/// to be emitted. /// to be emitted.
/// ///
@ -48,8 +54,17 @@ struct MachineCodeEmitter {
/// address of a global value to machine code. This is important for indirect /// address of a global value to machine code. This is important for indirect
/// calls as well as accessing global variables. /// calls as well as accessing global variables.
/// ///
virtual void emitGlobalAddress(GlobalValue *V) {} virtual void emitGlobalAddress(GlobalValue *V, bool isPCRelative) {}
virtual void emitGlobalAddress(const std::string &Name, bool isPCRelative) {}
/// emitFunctionConstantValueAddress - This callback is invoked when the
/// address of a constant, which was spilled to memory, needs to be addressed.
/// This is used for constants which cannot be directly specified as operands
/// to instructions, such as large integer values on the sparc, or floating
/// point constants on the X86.
///
virtual void emitFunctionConstantValueAddress(unsigned ConstantNum,
int Offset) {}
/// createDebugMachineCodeEmitter - Return a dynamically allocated machine /// createDebugMachineCodeEmitter - Return a dynamically allocated machine
/// code emitter, which just prints the opcodes and fields out the cout. This /// code emitter, which just prints the opcodes and fields out the cout. This