Update of 94055 to track the IR level call site information via an intrinsic.

This allows code gen and the exception table writer to cooperate to make sure
landing pads are associated with the correct invoke locations.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94726 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Grosbach
2010-01-28 01:45:32 +00:00
parent 4fcd607c56
commit ca752c9020
7 changed files with 84 additions and 8 deletions

View File

@ -113,7 +113,14 @@ class MachineModuleInfo : public ImmutablePass {
// LandingPads - List of LandingPadInfo describing the landing pad information
// in the current function.
std::vector<LandingPadInfo> LandingPads;
// Map of invoke call site index values to associated begin EH_LABEL for
// the current function.
DenseMap<unsigned, unsigned> CallSiteMap;
// The current call site index being processed, if any. 0 if none.
unsigned CurCallSite;
// TypeInfos - List of C++ TypeInfo used in the current function.
//
std::vector<GlobalVariable *> TypeInfos;
@ -294,7 +301,26 @@ public:
const std::vector<LandingPadInfo> &getLandingPads() const {
return LandingPads;
}
/// setCallSiteBeginLabel - Map the begin label for a call site
void setCallSiteBeginLabel(unsigned BeginLabel, unsigned Site) {
CallSiteMap[BeginLabel] = Site;
}
/// getCallSiteBeginLabel - Get the call site number for a begin label
unsigned getCallSiteBeginLabel(unsigned BeginLabel) {
assert(CallSiteMap.count(BeginLabel) &&
"Missing call site number for EH_LABEL!");
return CallSiteMap[BeginLabel];
}
/// setCurrentCallSite - Set the call site currently being processed.
void setCurrentCallSite(unsigned Site) { CurCallSite = Site; }
/// getCurrentCallSite - Get the call site currently being processed, if any.
/// return zero if none.
unsigned getCurrentCallSite(void) { return CurCallSite; }
/// getTypeInfos - Return a reference to the C++ typeinfo for the current
/// function.
const std::vector<GlobalVariable *> &getTypeInfos() const {