summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineCodeEmitter.cpp
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2006-04-22 18:53:45 +0000
committerNate Begeman <natebegeman@mac.com>2006-04-22 18:53:45 +0000
commit4ca2ea5b43a69c3786f8636675b486455a2cbf3f (patch)
treec773e752243da2d8cdb31290fd9b3d8edeba04ec /llvm/lib/CodeGen/MachineCodeEmitter.cpp
parente728efdfce8bb978a576fa3ba9306d17d565b077 (diff)
downloadbcm5719-llvm-4ca2ea5b43a69c3786f8636675b486455a2cbf3f.tar.gz
bcm5719-llvm-4ca2ea5b43a69c3786f8636675b486455a2cbf3f.zip
JumpTable support! What this represents is working asm and jit support for
x86 and ppc for 100% dense switch statements when relocations are non-PIC. This support will be extended and enhanced in the coming days to support PIC, and less dense forms of jump tables. llvm-svn: 27947
Diffstat (limited to 'llvm/lib/CodeGen/MachineCodeEmitter.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineCodeEmitter.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineCodeEmitter.cpp b/llvm/lib/CodeGen/MachineCodeEmitter.cpp
index d37fef4003c..4243076d3e5 100644
--- a/llvm/lib/CodeGen/MachineCodeEmitter.cpp
+++ b/llvm/lib/CodeGen/MachineCodeEmitter.cpp
@@ -56,6 +56,7 @@ namespace {
{ return 0; }
uint64_t getConstantPoolEntryAddress(unsigned Num) { return 0; }
+ uint64_t getJumpTableEntryAddress(unsigned Num) { return 0; }
uint64_t getCurrentPCValue() { return 0; }
uint64_t getCurrentPCOffset() { return 0; }
};
@@ -97,7 +98,14 @@ namespace {
void emitConstantPool(MachineConstantPool *MCP) {
MCE.emitConstantPool(MCP);
}
-
+ void initJumpTableInfo(MachineJumpTableInfo *MJTI) {
+ MCE.initJumpTableInfo(MJTI);
+ }
+ void emitJumpTableInfo(MachineJumpTableInfo *MJTI,
+ std::map<MachineBasicBlock*,uint64_t> &MBBM) {
+ MCE.emitJumpTableInfo(MJTI, MBBM);
+ }
+
void startFunctionStub(unsigned StubSize) {
MCE.startFunctionStub(StubSize);
}
@@ -146,7 +154,9 @@ namespace {
uint64_t getConstantPoolEntryAddress(unsigned Num) {
return MCE.getConstantPoolEntryAddress(Num);
}
-
+ uint64_t getJumpTableEntryAddress(unsigned Num) {
+ return MCE.getJumpTableEntryAddress(Num);
+ }
virtual unsigned char* allocateGlobal(unsigned size, unsigned alignment)
{ return MCE.allocateGlobal(size, alignment); }
OpenPOWER on IntegriCloud