[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:
Sanjoy Das 2015-07-02 02:53:34 +00:00
parent c6f1b8a4ba
commit c720b8690d

View File

@ -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