aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/IR/Statepoint.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-12-30 11:46:15 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-12-30 11:46:15 +0000
commitdd58ef019b700900793a1eb48b52123db01b654e (patch)
treefcfbb4df56a744f4ddc6122c50521dd3f1c5e196 /include/llvm/IR/Statepoint.h
parent2fe5752e3a7c345cdb59e869278d36af33c13fa4 (diff)
downloadsrc-dd58ef019b700900793a1eb48b52123db01b654e.tar.gz
src-dd58ef019b700900793a1eb48b52123db01b654e.zip
Vendor import of llvm trunk r256633:
Notes
Notes: svn path=/vendor/llvm/dist/; revision=292915
Diffstat (limited to 'include/llvm/IR/Statepoint.h')
-rw-r--r--include/llvm/IR/Statepoint.h29
1 files changed, 13 insertions, 16 deletions
diff --git a/include/llvm/IR/Statepoint.h b/include/llvm/IR/Statepoint.h
index 4ab1f8497adb..7310c5697a7e 100644
--- a/include/llvm/IR/Statepoint.h
+++ b/include/llvm/IR/Statepoint.h
@@ -173,7 +173,7 @@ public:
/// range adapter for call arguments
iterator_range<arg_iterator> call_args() const {
- return iterator_range<arg_iterator>(arg_begin(), arg_end());
+ return make_range(arg_begin(), arg_end());
}
/// \brief Return true if the call or the callee has the given attribute.
@@ -201,8 +201,7 @@ public:
/// range adapter for GC transition arguments
iterator_range<arg_iterator> gc_transition_args() const {
- return iterator_range<arg_iterator>(gc_transition_args_begin(),
- gc_transition_args_end());
+ return make_range(gc_transition_args_begin(), gc_transition_args_end());
}
/// Number of additional arguments excluding those intended
@@ -225,7 +224,7 @@ public:
/// range adapter for vm state arguments
iterator_range<arg_iterator> vm_state_args() const {
- return iterator_range<arg_iterator>(vm_state_begin(), vm_state_end());
+ return make_range(vm_state_begin(), vm_state_end());
}
typename CallSiteTy::arg_iterator gc_args_begin() const {
@@ -235,9 +234,13 @@ public:
return getCallSite().arg_end();
}
+ unsigned gcArgsStartIdx() const {
+ return gc_args_begin() - getInstruction()->op_begin();
+ }
+
/// range adapter for gc arguments
iterator_range<arg_iterator> gc_args() const {
- return iterator_range<arg_iterator>(gc_args_begin(), gc_args_end());
+ return make_range(gc_args_begin(), gc_args_end());
}
/// Get list of all gc reloactes linked to this statepoint
@@ -320,7 +323,7 @@ public:
bool isTiedToInvoke() const {
const Value *Token = RelocateCS.getArgument(0);
- return isa<ExtractValueInst>(Token) || isa<InvokeInst>(Token);
+ return isa<LandingPadInst>(Token) || isa<InvokeInst>(Token);
}
/// Get enclosed relocate intrinsic
@@ -332,7 +335,7 @@ public:
// This takes care both of relocates for call statepoints and relocates
// on normal path of invoke statepoint.
- if (!isa<ExtractValueInst>(Token)) {
+ if (!isa<LandingPadInst>(Token)) {
return cast<Instruction>(Token);
}
@@ -396,16 +399,10 @@ StatepointBase<FunTy, InstructionTy, ValueTy, CallSiteTy>::getRelocates()
LandingPadInst *LandingPad =
cast<InvokeInst>(getInstruction())->getLandingPadInst();
- // Search for extract value from landingpad instruction to which
- // gc relocates will be attached
+ // Search for gc relocates that are attached to this landingpad.
for (const User *LandingPadUser : LandingPad->users()) {
- if (!isa<ExtractValueInst>(LandingPadUser))
- continue;
-
- // gc relocates should be attached to this extract value
- for (const User *U : LandingPadUser->users())
- if (isGCRelocate(U))
- Result.push_back(GCRelocateOperands(U));
+ if (isGCRelocate(LandingPadUser))
+ Result.push_back(GCRelocateOperands(LandingPadUser));
}
return Result;
}