diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-14 01:41:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-14 01:41:15 +0000 |
commit | 1611273351d75b5cbe2a67485bb9831d5916fe26 (patch) | |
tree | 0fa59fecf1480ead468d8c2208a8a95ae2e2e875 /include/llvm/CodeGen/MachineModuleInfo.h | |
parent | bf2d4c034da3a0109175d1c48c2c898b496a18b9 (diff) |
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 'include/llvm/CodeGen/MachineModuleInfo.h')
-rw-r--r-- | include/llvm/CodeGen/MachineModuleInfo.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h index 3ad91adcea..b4b641858e 100644 --- a/include/llvm/CodeGen/MachineModuleInfo.h +++ b/include/llvm/CodeGen/MachineModuleInfo.h @@ -77,18 +77,15 @@ protected: /// the current function. /// struct LandingPadInfo { - MachineBasicBlock *LandingPadBlock; // Landing pad block. - SmallVector<unsigned, 1> BeginLabels; // Labels prior to invoke. - SmallVector<unsigned, 1> EndLabels; // Labels after invoke. - unsigned LandingPadLabel; // Label at beginning of landing pad. - Function *Personality; // Personality function. - std::vector<int> TypeIds; // List of type ids (filters negative) + MachineBasicBlock *LandingPadBlock; // Landing pad block. + SmallVector<MCSymbol*, 1> BeginLabels; // Labels prior to invoke. + SmallVector<MCSymbol*, 1> EndLabels; // Labels after invoke. + MCSymbol *LandingPadLabel; // Label at beginning of landing pad. + Function *Personality; // Personality function. + std::vector<int> TypeIds; // List of type ids (filters negative) explicit LandingPadInfo(MachineBasicBlock *MBB) - : LandingPadBlock(MBB) - , LandingPadLabel(0) - , Personality(NULL) - {} + : LandingPadBlock(MBB), LandingPadLabel(0), Personality(0) {} }; //===----------------------------------------------------------------------===// @@ -121,7 +118,7 @@ class MachineModuleInfo : public ImmutablePass { // Map of invoke call site index values to associated begin EH_LABEL for // the current function. - DenseMap<unsigned, unsigned> CallSiteMap; + DenseMap<MCSymbol*, unsigned> CallSiteMap; // The current call site index being processed, if any. 0 if none. unsigned CurCallSite; @@ -215,6 +212,9 @@ public: return ID; } + /// getLabelSym - Turn a label ID into a symbol. + MCSymbol *getLabelSym(unsigned ID); + /// InvalidateLabel - Inhibit use of the specified label # from /// MachineModuleInfo, for example because the code was deleted. void InvalidateLabel(unsigned LabelID) { @@ -245,8 +245,8 @@ public: /// addInvoke - Provide the begin and end labels of an invoke style call and /// associate it with a try landing pad block. - void addInvoke(MachineBasicBlock *LandingPad, unsigned BeginLabel, - unsigned EndLabel); + void addInvoke(MachineBasicBlock *LandingPad, + MCSymbol *BeginLabel, MCSymbol *EndLabel); /// addLandingPad - Add a new panding pad. Returns the label ID for the /// landing pad entry. @@ -305,12 +305,12 @@ public: } /// setCallSiteBeginLabel - Map the begin label for a call site - void setCallSiteBeginLabel(unsigned BeginLabel, unsigned Site) { + void setCallSiteBeginLabel(MCSymbol *BeginLabel, unsigned Site) { CallSiteMap[BeginLabel] = Site; } /// getCallSiteBeginLabel - Get the call site number for a begin label - unsigned getCallSiteBeginLabel(unsigned BeginLabel) { + unsigned getCallSiteBeginLabel(MCSymbol *BeginLabel) { assert(CallSiteMap.count(BeginLabel) && "Missing call site number for EH_LABEL!"); return CallSiteMap[BeginLabel]; |