1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

[Statepoint] Add helper functions for GCRelocate and GCResult

These functions isGCRelocate and isGCResult are
similar to isStatepoint(const Value*).

llvm-svn: 305847
This commit is contained in:
Anna Thomas 2017-06-20 20:54:57 +00:00
parent a1892fc5c5
commit eee230003b
2 changed files with 15 additions and 0 deletions

View File

@ -62,7 +62,10 @@ bool isStatepoint(const Value *V);
bool isStatepoint(const Value &V);
bool isGCRelocate(ImmutableCallSite CS);
bool isGCRelocate(const Value *V);
bool isGCResult(ImmutableCallSite CS);
bool isGCResult(const Value *V);
/// Analogous to CallSiteBase, this provides most of the actual
/// functionality for Statepoint and ImmutableStatepoint. It is

View File

@ -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");