aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineModuleInfo.h
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-06-02 16:53:42 +0000
committerDuncan Sands <baldrick@free.fr>2007-06-02 16:53:42 +0000
commit73ef58ab92d5cd23b119b7f206e5f8a8c529098d (patch)
tree6cf1db0c4b0ff8d89c195a92d8d25d19b38b257c /include/llvm/CodeGen/MachineModuleInfo.h
parent02031c0ff8ad48acdb8c4a4058c4fafe600423e1 (diff)
Integrate exception filter support and exception catch support. This
simplifies the code in DwarfWriter, allows for multiple filters and makes it trivial to specify filters accompanied by cleanups or catch-all specifications (see next patch). What a deal! Patch blessed by Anton. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37398 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineModuleInfo.h')
-rw-r--r--include/llvm/CodeGen/MachineModuleInfo.h36
1 files changed, 24 insertions, 12 deletions
diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h
index c13ba51752..790433e8b4 100644
--- a/include/llvm/CodeGen/MachineModuleInfo.h
+++ b/include/llvm/CodeGen/MachineModuleInfo.h
@@ -960,16 +960,13 @@ struct LandingPadInfo {
SmallVector<unsigned, 1> EndLabels; // Labels after invoke.
unsigned LandingPadLabel; // Label at beginning of landing pad.
Function *Personality; // Personality function.
- std::vector<unsigned> TypeIds; // List of type ids.
- bool IsFilter; // Indicate if the landing pad is a
- // throw filter.
-
+ std::vector<int> TypeIds; // List of type ids (filters negative)
+
LandingPadInfo(MachineBasicBlock *MBB)
: LandingPadBlock(MBB)
, LandingPadLabel(0)
, Personality(NULL)
, TypeIds()
- , IsFilter(false)
{}
};
@@ -1021,6 +1018,10 @@ private:
//
std::vector<GlobalVariable *> TypeInfos;
+ // FilterIds - List of typeids encoding filters used in the current function.
+ //
+ std::vector<unsigned> FilterIds;
+
// Personalities - Vector of all personality functions ever seen. Used to emit
// common EH frames.
std::vector<Function *> Personalities;
@@ -1213,20 +1214,25 @@ public:
const std::vector<Function *>& getPersonalities() const {
return Personalities;
}
-
+
/// addCatchTypeInfo - Provide the catch typeinfo for a landing pad.
///
void addCatchTypeInfo(MachineBasicBlock *LandingPad,
std::vector<GlobalVariable *> &TyInfo);
-
- /// setIsFilterLandingPad - Indicates that the landing pad is a throw filter.
+
+ /// addFilterTypeInfo - Provide the filter typeinfo for a landing pad.
///
- void setIsFilterLandingPad(MachineBasicBlock *LandingPad);
-
+ void addFilterTypeInfo(MachineBasicBlock *LandingPad,
+ std::vector<GlobalVariable *> &TyInfo);
+
/// getTypeIDFor - Return the type id for the specified typeinfo. This is
/// function wide.
unsigned getTypeIDFor(GlobalVariable *TI);
-
+
+ /// getFilterIDFor - Return the id of the filter encoded by TyIds. This is
+ /// function wide.
+ int getFilterIDFor(std::vector<unsigned> &TyIds);
+
/// TidyLandingPads - Remap landing pad labels and remove any deleted landing
/// pads.
void TidyLandingPads();
@@ -1242,7 +1248,13 @@ public:
const std::vector<GlobalVariable *> &getTypeInfos() const {
return TypeInfos;
}
-
+
+ /// getFilterIds - Return a reference to the typeids encoding filters used in
+ /// the current function.
+ const std::vector<unsigned> &getFilterIds() const {
+ return FilterIds;
+ }
+
/// getPersonality - Return a personality function if available. The presence
/// of one is required to emit exception handling info.
Function *getPersonality() const;