aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-06-18 19:28:26 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-06-18 19:28:26 +0000
commitc65d43e64926c9f868213f453bb4cdc3d4ab7879 (patch)
tree2620519c537d573b07605b61b396df72d46e3752 /llvm/lib/IR/Function.cpp
parent5c38440b2b6866bf622ed5e81840587873455f96 (diff)
downloadllvm-c65d43e64926c9f868213f453bb4cdc3d4ab7879.zip
llvm-c65d43e64926c9f868213f453bb4cdc3d4ab7879.tar.gz
llvm-c65d43e64926c9f868213f453bb4cdc3d4ab7879.tar.bz2
[CallGraph] Teach the CallGraph about non-leaf intrinsics.
Summary: Currently intrinsics don't affect the creation of the call graph. This is not accurate with respect to statepoint and patchpoint intrinsics -- these do call (or invoke) LLVM level functions. This change fixes this inconsistency by adding a call to the external node for call sites that call these non-leaf intrinsics. This coupled with the fact that these intrinsics also escape the function pointer they call gives us a conservatively correct call graph. Reviewers: reames, chandlerc, atrick, pgavlin Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10526 llvm-svn: 240039
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r--llvm/lib/IR/Function.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index bc57dee..b50ad12 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -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"