summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Statepoint.cpp
diff options
context:
space:
mode:
authorAnna Thomas <anna@azul.com>2017-06-20 20:54:57 +0000
committerAnna Thomas <anna@azul.com>2017-06-20 20:54:57 +0000
commitf765cad13eb49dd718224d124160aa3a03443812 (patch)
treebfadd1ab2bccdbcb717570373fed15a3cdeaa3e4 /llvm/lib/IR/Statepoint.cpp
parent8199dadab8237e25c39acdef7d8b1bc0835dff98 (diff)
downloadbcm5719-llvm-f765cad13eb49dd718224d124160aa3a03443812.tar.gz
bcm5719-llvm-f765cad13eb49dd718224d124160aa3a03443812.zip
[Statepoint] Add helper functions for GCRelocate and GCResult
These functions isGCRelocate and isGCResult are similar to isStatepoint(const Value*). llvm-svn: 305847
Diffstat (limited to 'llvm/lib/IR/Statepoint.cpp')
-rw-r--r--llvm/lib/IR/Statepoint.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/IR/Statepoint.cpp b/llvm/lib/IR/Statepoint.cpp
index 8c3f0f208cc..18efee2177c 100644
--- a/llvm/lib/IR/Statepoint.cpp
+++ b/llvm/lib/IR/Statepoint.cpp
@@ -44,10 +44,22 @@ bool llvm::isGCRelocate(ImmutableCallSite CS) {
return CS.getInstruction() && isa<GCRelocateInst>(CS.getInstruction());
}
+bool llvm::isGCRelocate(const Value *V) {
+ if (auto CS = ImmutableCallSite(V))
+ return isGCRelocate(CS);
+ return false;
+}
+
bool llvm::isGCResult(ImmutableCallSite CS) {
return CS.getInstruction() && isa<GCResultInst>(CS.getInstruction());
}
+bool llvm::isGCResult(const Value *V) {
+ if (auto CS = ImmutableCallSite(V))
+ return isGCResult(CS);
+ return false;
+}
+
bool llvm::isStatepointDirectiveAttr(Attribute Attr) {
return Attr.hasAttribute("statepoint-id") ||
Attr.hasAttribute("statepoint-num-patch-bytes");
OpenPOWER on IntegriCloud