Add a new attribute: norecurse
[oota-llvm.git] / include / llvm / IR / Function.h
index b8e22af4bfe3d72f92cc5e781986c18a62df0851..71822a462daa68da562c178c4932d99ac321966a 100644 (file)
@@ -329,6 +329,15 @@ public:
     addFnAttr(Attribute::Convergent);
   }
 
+  /// Determine if the function is known not to recurse, directly or
+  /// indirectly.
+  bool doesNotRecurse() const {
+    return AttributeSets.hasAttribute(AttributeSet::FunctionIndex,
+                                      Attribute::NoRecurse);
+  }
+  void setDoesNotRecurse() {
+    addFnAttr(Attribute::NoRecurse);
+  }  
 
   /// @brief True if the ABI mandates (or the user requested) that this
   /// function be in a unwind table.