static bool classof(const Value *V) {
return isa<CallBase>(V) && classof(cast<CallBase>(V));
}
+
+ enum {
+ IDPos = 0,
+ NumPatchBytesPos = 1,
+ CalledFunctionPos = 2,
+ NumCallArgsPos = 3,
+ FlagsPos = 4,
+ CallArgsBeginPos = 5,
+ };
+
+ /// Return the ID associated with this statepoint.
+ uint64_t getID() const {
+ return cast<ConstantInt>(getArgOperand(IDPos))->getZExtValue();
+ }
+
+ /// Return the number of patchable bytes associated with this statepoint.
+ uint32_t getNumPatchBytes() const {
+ const Value *NumPatchBytesVal = getArgOperand(NumPatchBytesPos);
+ uint64_t NumPatchBytes =
+ cast<ConstantInt>(NumPatchBytesVal)->getZExtValue();
+ assert(isInt<32>(NumPatchBytes) && "should fit in 32 bits!");
+ return NumPatchBytes;
+ }
+
+ /// Number of arguments to be passed to the actual callee.
+ int getNumCallArgs() const {
+ return cast<ConstantInt>(getArgOperand(NumCallArgsPos))->getZExtValue();
+ }
+
+ uint64_t getFlags() const {
+ return cast<ConstantInt>(getArgOperand(FlagsPos))->getZExtValue();
+ }
};
/// A wrapper around a GC intrinsic call, this provides most of the actual
using arg_iterator = typename CallTy::const_op_iterator;
enum {
- IDPos = 0,
- NumPatchBytesPos = 1,
- CalledFunctionPos = 2,
- NumCallArgsPos = 3,
- FlagsPos = 4,
- CallArgsBeginPos = 5,
+ CalledFunctionPos = GCStatepointInst::CalledFunctionPos,
+ CallArgsBeginPos = GCStatepointInst::CallArgsBeginPos,
};
void *operator new(size_t, unsigned) = delete;
return StatepointCall;
}
- uint64_t getFlags() const {
- return cast<ConstantInt>(getCall()->getArgOperand(FlagsPos))
- ->getZExtValue();
- }
+ // Deprecated shims (update all callers to remove)
+ uint64_t getFlags() const { return getCall()->getFlags(); }
+ uint64_t getID() const { return getCall()->getID(); }
+ uint32_t getNumPatchBytes() const { return getCall()->getNumPatchBytes(); }
+ int getNumCallArgs() const { return getCall()->getNumCallArgs(); }
- /// Return the ID associated with this statepoint.
- uint64_t getID() const {
- const Value *IDVal = getCall()->getArgOperand(IDPos);
- return cast<ConstantInt>(IDVal)->getZExtValue();
- }
-
- /// Return the number of patchable bytes associated with this statepoint.
- uint32_t getNumPatchBytes() const {
- const Value *NumPatchBytesVal = getCall()->getArgOperand(NumPatchBytesPos);
- uint64_t NumPatchBytes =
- cast<ConstantInt>(NumPatchBytesVal)->getZExtValue();
- assert(isInt<32>(NumPatchBytes) && "should fit in 32 bits!");
- return NumPatchBytes;
- }
/// Return the value actually being called or invoked.
ValueTy *getCalledValue() const {
return FTy->getReturnType();
}
- /// Number of arguments to be passed to the actual callee.
- int getNumCallArgs() const {
- const Value *NumCallArgsVal = getCall()->getArgOperand(NumCallArgsPos);
- return cast<ConstantInt>(NumCallArgsVal)->getZExtValue();
- }
-
size_t arg_size() const { return getNumCallArgs(); }
arg_iterator arg_begin() const {
assert(CallArgsBeginPos <= (int)getCall()->arg_size());