mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01: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:
parent
a1892fc5c5
commit
eee230003b
@ -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
|
||||
|
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user