mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-21 11:38:35 +00:00
[Statepoints][NFC] Add Statepoint::getGCResult.
Summary: Introduce a simple accessor to get the gc_result hanging off of a statepoint. (I don't think this change needs review, this was uploaded to phabricator to provide context for later dependent changes.) Differential Revision: http://reviews.llvm.org/D10627 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241231 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c6f1b8a4ba
commit
c720b8690d
@ -200,6 +200,17 @@ public:
|
||||
/// path of invoke.
|
||||
std::vector<GCRelocateOperands> getRelocates();
|
||||
|
||||
/// Get the experimental_gc_result call tied to this statepoint. Can be
|
||||
/// nullptr if there isn't a gc_result tied to this statepoint. Guaranteed to
|
||||
/// be a CallInst if non-null.
|
||||
InstructionTy *getGCResult() {
|
||||
for (auto *U : getCallSite().getInstruction()->users())
|
||||
if (isGCResult(U))
|
||||
return cast<CallInst>(U);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
/// Asserts if this statepoint is malformed. Common cases for failure
|
||||
/// include incorrect length prefixes for variable length sections or
|
||||
|
Loading…
Reference in New Issue
Block a user