aboutsummaryrefslogtreecommitdiffstats
path: root/include
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
parent4fcd607c5614ffb62b4012682d7223c1e93423b6 (diff)
downloadexternal_llvm-ca752c9020a1b1cf151142bd9e0cbca9af12d807.tar.gz
external_llvm-ca752c9020a1b1cf151142bd9e0cbca9af12d807.tar.bz2
external_llvm-ca752c9020a1b1cf151142bd9e0cbca9af12d807.zip
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')
-rw-r--r--include/llvm/CodeGen/MachineModuleInfo.h30
-rw-r--r--include/llvm/Intrinsics.td1
2 files changed, 29 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 {
diff --git a/include/llvm/Intrinsics.td b/include/llvm/Intrinsics.td
index 684f8724cf..3a0da9cabd 100644
--- a/include/llvm/Intrinsics.td
+++ b/include/llvm/Intrinsics.td
@@ -309,6 +309,7 @@ let Properties = [IntrNoMem] in {
def int_eh_sjlj_setjmp : Intrinsic<[llvm_i32_ty], [llvm_ptr_ty]>;
def int_eh_sjlj_longjmp : Intrinsic<[llvm_void_ty], [llvm_ptr_ty]>;
def int_eh_sjlj_lsda : Intrinsic<[llvm_ptr_ty]>;
+ def int_eh_sjlj_callsite: Intrinsic<[llvm_void_ty], [llvm_i32_ty]>;
}
//===---------------- Generic Variable Attribute Intrinsics----------------===//