mirror of
https://github.com/RPCS3/llvm.git
synced 2025-05-14 09:26:22 +00:00
[coro] Make Spill a proper struct instead of deriving from pair.
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317027 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d619fda3f4
commit
aeaa65aec3
@ -261,21 +261,19 @@ SuspendCrossingInfo::SuspendCrossingInfo(Function &F, coro::Shape &Shape)
|
|||||||
// We build up the list of spills for every case where a use is separated
|
// We build up the list of spills for every case where a use is separated
|
||||||
// from the definition by a suspend point.
|
// from the definition by a suspend point.
|
||||||
|
|
||||||
struct Spill : std::pair<Value *, Instruction *> {
|
namespace {
|
||||||
using base = std::pair<Value *, Instruction *>;
|
class Spill {
|
||||||
|
Value *Def;
|
||||||
|
Instruction *User;
|
||||||
|
|
||||||
Spill(Value *Def, User *U) : base(Def, cast<Instruction>(U)) {}
|
public:
|
||||||
|
Spill(Value *Def, llvm::User *U) : Def(Def), User(cast<Instruction>(U)) {}
|
||||||
|
|
||||||
Value *def() const { return first; }
|
Value *def() const { return Def; }
|
||||||
Instruction *user() const { return second; }
|
Instruction *user() const { return User; }
|
||||||
BasicBlock *userBlock() const { return second->getParent(); }
|
BasicBlock *userBlock() const { return User->getParent(); }
|
||||||
|
|
||||||
std::pair<Value *, BasicBlock *> getKey() const {
|
|
||||||
return {def(), userBlock()};
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator<(Spill const &rhs) const { return getKey() < rhs.getKey(); }
|
|
||||||
};
|
};
|
||||||
|
} // namespace
|
||||||
|
|
||||||
// Note that there may be more than one record with the same value of Def in
|
// Note that there may be more than one record with the same value of Def in
|
||||||
// the SpillInfo vector.
|
// the SpillInfo vector.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user