explicit keywords.
[oota-llvm.git] / include / llvm / CodeGen / MachineModuleInfo.h
index 3c04c8c4898ea44a92c8b297c11beda9e7cd8864..3346c95bba752cd810a8b98d12860b3b1cbac0eb 100644 (file)
@@ -97,7 +97,7 @@ private:
                                         // Dwarf writers.
   
 protected:
-  DebugInfoDesc(unsigned T) : Tag(T | LLVMDebugVersion) {}
+  explicit DebugInfoDesc(unsigned T) : Tag(T | LLVMDebugVersion) {}
   
 public:
   virtual ~DebugInfoDesc() {}
@@ -161,7 +161,7 @@ private:
   
 public:
   AnchorDesc();
-  AnchorDesc(AnchoredDesc *D);
+  explicit AnchorDesc(AnchoredDesc *D);
   
   // Accessors
   unsigned getAnchorTag() const { return AnchorTag; }
@@ -201,7 +201,7 @@ private:
 
 protected:
 
-  AnchoredDesc(unsigned T);
+  explicit AnchoredDesc(unsigned T);
 
 public:  
   // Accessors.
@@ -291,7 +291,7 @@ private:
   unsigned Flags;                       // Miscellaneous flags.
 
 public:
-  TypeDesc(unsigned T);
+  explicit TypeDesc(unsigned T);
 
   // Accessors
   DebugInfoDesc *getContext()                const { return Context; }
@@ -382,7 +382,7 @@ private:
   DebugInfoDesc *FromType;              // Type derived from.
 
 public:
-  DerivedTypeDesc(unsigned T);
+  explicit DerivedTypeDesc(unsigned T);
   
   // Accessors
   TypeDesc *getFromType() const {
@@ -421,7 +421,7 @@ private:
   std::vector<DebugInfoDesc *> Elements;// Information used to compose type.
 
 public:
-  CompositeTypeDesc(unsigned T);
+  explicit CompositeTypeDesc(unsigned T);
   
   // Accessors
   std::vector<DebugInfoDesc *> &getElements() { return Elements; }
@@ -536,7 +536,7 @@ private:
   DebugInfoDesc *TyDesc;                // Type of variable.
 
 public:
-  VariableDesc(unsigned T);
+  explicit VariableDesc(unsigned T);
 
   // Accessors
   DebugInfoDesc *getContext()                const { return Context; }
@@ -595,7 +595,7 @@ private:
   bool IsDefinition;                    // Is the global defined in context.
   
 protected:
-  GlobalDesc(unsigned T);
+  explicit GlobalDesc(unsigned T);
 
 public:
   // Accessors
@@ -960,15 +960,12 @@ 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.
-  
-  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)  
   {}
 };
 
@@ -1020,7 +1017,21 @@ private:
   //
   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
 
@@ -1063,6 +1074,12 @@ public:
   /// 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.
   ///
@@ -1201,25 +1218,43 @@ public:
   /// 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;
@@ -1230,7 +1265,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;