1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

[Statepoint] Start the process of removing old interfaces

We introduced the GCStatepointInst class and have migrated almost all users of Statepoint/ImmutableStatepoint to the new API.  Given downstream consumers have had a week to migrate, remove code which is now dead.
This commit is contained in:
Philip Reames 2020-06-03 19:49:25 -07:00
parent 5569a187ee
commit 1489b32b37
2 changed files with 1 additions and 100 deletions

View File

@ -55,16 +55,6 @@ enum class StatepointFlags {
class GCRelocateInst; class GCRelocateInst;
class GCResultInst; class GCResultInst;
bool isStatepoint(const CallBase *Call);
bool isStatepoint(const Value *V);
bool isStatepoint(const Value &V);
bool isGCRelocate(const CallBase *Call);
bool isGCRelocate(const Value *V);
bool isGCResult(const CallBase *Call);
bool isGCResult(const Value *V);
/// Represents a gc.statepoint intrinsic call. This extends directly from /// Represents a gc.statepoint intrinsic call. This extends directly from
/// CallBase as the IntrinsicInst only supports calls and gc.statepoint is /// CallBase as the IntrinsicInst only supports calls and gc.statepoint is
/// invokable. /// invokable.
@ -248,32 +238,6 @@ public:
return StatepointCall; return StatepointCall;
} }
// 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(); }
ValueTy *getCalledValue() const {
return getCall()->getActualCalledOperand();
}
Type *getActualReturnType() const { return getCall()->getActualReturnType(); }
FunTy *getCalledFunction() const {
return getCall()->getActualCalledFunction();
}
// FIXME: Migrate users of this to `getCall` and remove it.
InstructionTy *getInstruction() const { return getCall(); }
/// Return the caller function for this statepoint.
FunTy *getCaller() const { return getCall()->getCaller(); }
/// Determine if the statepoint cannot unwind.
bool doesNotThrow() const {
Function *F = getCalledFunction();
return getCall()->doesNotThrow() || (F ? F->doesNotThrow() : false);
}
size_t arg_size() const { return getCall()->actual_arg_size(); } size_t arg_size() const { return getCall()->actual_arg_size(); }
arg_iterator arg_begin() const { return getCall()->actual_arg_begin(); } arg_iterator arg_begin() const { return getCall()->actual_arg_begin(); }
arg_iterator arg_end() const { return getCall()->actual_arg_end(); } arg_iterator arg_end() const { return getCall()->actual_arg_end(); }
@ -281,18 +245,6 @@ public:
return getCall()->actual_args(); return getCall()->actual_args();
} }
ValueTy *getArgument(unsigned Index) {
assert(Index < arg_size() && "out of bounds!");
return *(arg_begin() + Index);
}
/// Return true if the call or the callee has the given attribute.
bool paramHasAttr(unsigned i, Attribute::AttrKind A) const {
Function *F = getCalledFunction();
return getCall()->paramHasAttr(i + CallArgsBeginPos, A) ||
(F ? F->getAttributes().hasAttribute(i, A) : false);
}
/// Number of GC transition args. /// Number of GC transition args.
int getNumTotalGCTransitionArgs() const { int getNumTotalGCTransitionArgs() const {
const Value *NumGCTransitionArgs = *arg_end(); const Value *NumGCTransitionArgs = *arg_end();
@ -348,21 +300,11 @@ public:
return getCall()->gc_args(); return getCall()->gc_args();
} }
std::vector<const GCRelocateInst *> getRelocates() const {
return getCall()->getGCRelocates();
}
const GCResultInst *getGCResult() const {
return getCall()->getGCResult();
}
#ifndef NDEBUG #ifndef NDEBUG
/// Asserts if this statepoint is malformed. Common cases for failure /// Asserts if this statepoint is malformed. Common cases for failure
/// include incorrect length prefixes for variable length sections or /// include incorrect length prefixes for variable length sections or
/// illegal values for parameters. /// illegal values for parameters.
void verify() { void verify() {
assert(getNumCallArgs() >= 0 &&
"number of arguments to actually callee can't be negative");
// The internal asserts in the iterator accessors do the rest. // The internal asserts in the iterator accessors do the rest.
(void)arg_begin(); (void)arg_begin();
(void)arg_end(); (void)arg_end();
@ -377,7 +319,7 @@ public:
}; };
/// A specialization of it's base class for read only access /// A specialization of it's base class for read only access
/// to a gc.statepoint. /// to a gc.statepoint. DEPRECATED. Use GCStatepointInst instead!
class ImmutableStatepoint class ImmutableStatepoint
: public StatepointBase<const Function, const Instruction, const Value, : public StatepointBase<const Function, const Instruction, const Value,
const GCStatepointInst> { const GCStatepointInst> {
@ -389,17 +331,6 @@ public:
explicit ImmutableStatepoint(const CallBase *Call) : Base(Call) {} explicit ImmutableStatepoint(const CallBase *Call) : Base(Call) {}
}; };
/// A specialization of it's base class for read-write access
/// to a gc.statepoint.
class Statepoint
: public StatepointBase<Function, Instruction, Value, GCStatepointInst> {
using Base = StatepointBase<Function, Instruction, Value, GCStatepointInst>;
public:
explicit Statepoint(Instruction *I) : Base(I) {}
explicit Statepoint(CallBase *Call) : Base(Call) {}
};
/// Common base class for representing values projected from a statepoint. /// Common base class for representing values projected from a statepoint.
/// Currently, the only projections available are gc.result and gc.relocate. /// Currently, the only projections available are gc.result and gc.relocate.
class GCProjectionInst : public IntrinsicInst { class GCProjectionInst : public IntrinsicInst {

View File

@ -17,36 +17,6 @@
using namespace llvm; using namespace llvm;
bool llvm::isStatepoint(const CallBase *Call) {
return isa<GCStatepointInst>(Call);
}
bool llvm::isStatepoint(const Value *V) {
return isa<GCStatepointInst>(V);
}
bool llvm::isStatepoint(const Value &V) {
return isStatepoint(&V);
}
bool llvm::isGCRelocate(const CallBase *Call) {
return isa<GCRelocateInst>(Call);
}
bool llvm::isGCRelocate(const Value *V) {
if (auto *Call = dyn_cast<CallBase>(V))
return isGCRelocate(Call);
return false;
}
bool llvm::isGCResult(const CallBase *Call) { return isa<GCResultInst>(Call); }
bool llvm::isGCResult(const Value *V) {
if (auto *Call = dyn_cast<CallBase>(V))
return isGCResult(Call);
return false;
}
bool llvm::isStatepointDirectiveAttr(Attribute Attr) { bool llvm::isStatepointDirectiveAttr(Attribute Attr) {
return Attr.hasAttribute("statepoint-id") || return Attr.hasAttribute("statepoint-id") ||
Attr.hasAttribute("statepoint-num-patch-bytes"); Attr.hasAttribute("statepoint-num-patch-bytes");