// Dwarf writers.
protected:
- DebugInfoDesc(unsigned T) : Tag(T | LLVMDebugVersion) {}
+ explicit DebugInfoDesc(unsigned T) : Tag(T | LLVMDebugVersion) {}
public:
virtual ~DebugInfoDesc() {}
public:
AnchorDesc();
- AnchorDesc(AnchoredDesc *D);
+ explicit AnchorDesc(AnchoredDesc *D);
// Accessors
unsigned getAnchorTag() const { return AnchorTag; }
protected:
- AnchoredDesc(unsigned T);
+ explicit AnchoredDesc(unsigned T);
public:
// Accessors.
unsigned Flags; // Miscellaneous flags.
public:
- TypeDesc(unsigned T);
+ explicit TypeDesc(unsigned T);
// Accessors
DebugInfoDesc *getContext() const { return Context; }
DebugInfoDesc *FromType; // Type derived from.
public:
- DerivedTypeDesc(unsigned T);
+ explicit DerivedTypeDesc(unsigned T);
// Accessors
TypeDesc *getFromType() const {
std::vector<DebugInfoDesc *> Elements;// Information used to compose type.
public:
- CompositeTypeDesc(unsigned T);
+ explicit CompositeTypeDesc(unsigned T);
// Accessors
std::vector<DebugInfoDesc *> &getElements() { return Elements; }
DebugInfoDesc *TyDesc; // Type of variable.
public:
- VariableDesc(unsigned T);
+ explicit VariableDesc(unsigned T);
// Accessors
DebugInfoDesc *getContext() const { return Context; }
bool IsDefinition; // Is the global defined in context.
protected:
- GlobalDesc(unsigned T);
+ explicit GlobalDesc(unsigned T);
public:
// Accessors
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.
-
- LandingPadInfo(MachineBasicBlock *MBB)
+ std::vector<int> TypeIds; // List of type ids (filters negative)
+
+ explicit LandingPadInfo(MachineBasicBlock *MBB)
: LandingPadBlock(MBB)
, LandingPadLabel(0)
- , TypeIds()
- , IsFilter(false)
+ , Personality(NULL)
{}
};
//
std::vector<GlobalVariable *> TypeInfos;
- Function *Personality;
+ // FilterIds - List of typeids encoding filters used in the current function.
+ //
+ std::vector<unsigned> FilterIds;
+
+ // FilterEnds - List of the indices in FilterIds corresponding to filter
+ // terminators.
+ //
+ std::vector<unsigned> FilterEnds;
+
+ // Personalities - Vector of all personality functions ever seen. Used to emit
+ // common EH frames.
+ std::vector<Function *> Personalities;
+
+ bool CallsEHReturn;
+ bool CallsUnwindInit;
public:
static char ID; // Pass identification, replacement for typeid
/// needsFrameInfo - Returns true if we need to gather callee-saved register
/// move info for the frame.
bool needsFrameInfo() const;
+
+ bool callsEHReturn() const { return CallsEHReturn; }
+ void setCallsEHReturn(bool b) { CallsEHReturn = b; }
+
+ bool callsUnwindInit() const { return CallsUnwindInit; }
+ void setCallsUnwindInit(bool b) { CallsUnwindInit = b; }
/// NextLabelID - Return the next unique label id.
///
/// addPersonality - Provide the personality function for the exception
/// information.
void addPersonality(MachineBasicBlock *LandingPad, Function *Personality);
-
+
+ /// getPersonalityIndex - Get index of the current personality function inside
+ /// Personalitites array
+ unsigned getPersonalityIndex() const;
+
+ /// getPersonalities - Return array of personality functions ever seen.
+ 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);
+
+ /// addCleanup - Add a cleanup action for a landing pad.
+ ///
+ void addCleanup(MachineBasicBlock *LandingPad);
+
/// 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();
- /// getLandingPadInfos - Return a reference to the landing pad info for the
+ /// getLandingPads - Return a reference to the landing pad info for the
/// current function.
const std::vector<LandingPadInfo> &getLandingPads() const {
return LandingPads;
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;