Add accessor method to check if the landing pad symbol has call site information.
[oota-llvm.git] / include / llvm / CodeGen / MachineModuleInfo.h
index a09a71400ddea36b5e98b98fe33c838a19f675f1..2bf7f1788f8a2fdc6f5836b61cb476507fe813d8 100644 (file)
@@ -338,9 +338,17 @@ public:
   /// getCallSiteLandingPad - Get the call site indexes for a landing pad EH
   /// symbol.
   SmallVectorImpl<unsigned> &getCallSiteLandingPad(MCSymbol *Sym) {
+    assert(hasCallSiteLandingPad(Sym) &&
+           "missing call site number for landing pad!");
     return LPadToCallSiteMap[Sym];
   }
 
+  /// hasCallSiteLandingPad - Return true if the landing pad Eh symbol has an
+  /// associated call site.
+  bool hasCallSiteLandingPad(MCSymbol *Sym) {
+    return !LPadToCallSiteMap[Sym].empty();
+  }
+
   /// setCallSiteBeginLabel - Map the begin label for a call site.
   void setCallSiteBeginLabel(MCSymbol *BeginLabel, unsigned Site) {
     CallSiteMap[BeginLabel] = Site;