[CallGraph] Teach the CallGraph about non-leaf intrinsics.
[oota-llvm.git] / lib / IR / Function.cpp
index bc57dee0af0a40ff3b04b42f2bff02b4d71ac492..b50ad1262c69904f1cc40f534cf368671e554a32 100644 (file)
@@ -846,6 +846,18 @@ bool Intrinsic::isOverloaded(ID id) {
 #undef GET_INTRINSIC_OVERLOAD_TABLE
 }
 
+bool Intrinsic::isLeaf(ID id) {
+  switch (id) {
+  default:
+    return true;
+
+  case Intrinsic::experimental_gc_statepoint:
+  case Intrinsic::experimental_patchpoint_void:
+  case Intrinsic::experimental_patchpoint_i64:
+    return false;
+  }
+}
+
 /// This defines the "Intrinsic::getAttributes(ID id)" method.
 #define GET_INTRINSIC_ATTRIBUTES
 #include "llvm/IR/Intrinsics.gen"