diff --git a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp index d192fa699f36..6334256bf03a 100644 --- a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp +++ b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp @@ -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 // from the definition by a suspend point. -struct Spill : std::pair { - using base = std::pair; +namespace { +class Spill { + Value *Def; + Instruction *User; - Spill(Value *Def, User *U) : base(Def, cast(U)) {} +public: + Spill(Value *Def, llvm::User *U) : Def(Def), User(cast(U)) {} - Value *def() const { return first; } - Instruction *user() const { return second; } - BasicBlock *userBlock() const { return second->getParent(); } - - std::pair getKey() const { - return {def(), userBlock()}; - } - - bool operator<(Spill const &rhs) const { return getKey() < rhs.getKey(); } + Value *def() const { return Def; } + Instruction *user() const { return User; } + BasicBlock *userBlock() const { return User->getParent(); } }; +} // namespace // Note that there may be more than one record with the same value of Def in // the SpillInfo vector.