summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/JIT/JITEmitter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-14 01:41:15 +0000
committerChris Lattner <sabre@nondot.org>2010-03-14 01:41:15 +0000
commit1611273351d75b5cbe2a67485bb9831d5916fe26 (patch)
tree0fa59fecf1480ead468d8c2208a8a95ae2e2e875 /lib/ExecutionEngine/JIT/JITEmitter.cpp
parentbf2d4c034da3a0109175d1c48c2c898b496a18b9 (diff)
downloadllvm-1611273351d75b5cbe2a67485bb9831d5916fe26.tar.gz
llvm-1611273351d75b5cbe2a67485bb9831d5916fe26.tar.bz2
llvm-1611273351d75b5cbe2a67485bb9831d5916fe26.tar.xz
change EH related stuff (other than EH_LABEL) to use MCSymbol
instead of label ID's. This cleans up and regularizes a bunch of code and makes way for future progress. Unfortunately, this pointed out to me that JITDwarfEmitter.cpp is largely copy and paste from DwarfException/MachineModuleInfo and other places. This is very sad and disturbing. :( One major change here is that TidyLandingPads moved from being called in DwarfException::BeginFunction to being called in DwarfException::EndFunction. There should not be any functionality change from doing this, but I'm not an EH expert. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98459 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT/JITEmitter.cpp')
-rw-r--r--lib/ExecutionEngine/JIT/JITEmitter.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp
index 26353f794f..83acb5df97 100644
--- a/lib/ExecutionEngine/JIT/JITEmitter.cpp
+++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp
@@ -341,7 +341,7 @@ namespace {
/// LabelLocations - This vector is a mapping from Label ID's to their
/// address.
- std::vector<uintptr_t> LabelLocations;
+ DenseMap<MCSymbol*, uintptr_t> LabelLocations;
/// MMI - Machine module info for exception informations
MachineModuleInfo* MMI;
@@ -459,16 +459,13 @@ namespace {
virtual void processDebugLoc(DebugLoc DL, bool BeforePrintingInsn);
- virtual void emitLabel(uint64_t LabelID) {
- if (LabelLocations.size() <= LabelID)
- LabelLocations.resize((LabelID+1)*2);
- LabelLocations[LabelID] = getCurrentPCValue();
+ virtual void emitLabel(MCSymbol *Label) {
+ LabelLocations[Label] = getCurrentPCValue();
}
- virtual uintptr_t getLabelAddress(uint64_t LabelID) const {
- assert(LabelLocations.size() > (unsigned)LabelID &&
- LabelLocations[LabelID] && "Label not emitted!");
- return LabelLocations[LabelID];
+ virtual uintptr_t getLabelAddress(MCSymbol *Label) const {
+ assert(LabelLocations.count(Label) && "Label not emitted!");
+ return LabelLocations.find(Label)->second;
}
virtual void setModuleInfo(MachineModuleInfo* Info) {