summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineModuleInfo.h
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-01-28 01:45:32 +0000
committerJim Grosbach <grosbach@apple.com>2010-01-28 01:45:32 +0000
commitca752c9020a1b1cf151142bd9e0cbca9af12d807 (patch)
treef55e837ff0190e3a044cdc940753ceb3c1e4cef8 /include/llvm/CodeGen/MachineModuleInfo.h
parent4fcd607c5614ffb62b4012682d7223c1e93423b6 (diff)
downloadllvm-ca752c9020a1b1cf151142bd9e0cbca9af12d807.tar.gz
llvm-ca752c9020a1b1cf151142bd9e0cbca9af12d807.tar.bz2
llvm-ca752c9020a1b1cf151142bd9e0cbca9af12d807.tar.xz
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
Diffstat (limited to 'include/llvm/CodeGen/MachineModuleInfo.h')
-rw-r--r--include/llvm/CodeGen/MachineModuleInfo.h30
1 files changed, 28 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h
index d2bd0f1a88..556ba7f27e 100644
--- a/include/llvm/CodeGen/MachineModuleInfo.h
+++ b/include/llvm/CodeGen/MachineModuleInfo.h
@@ -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 {