[llvm] r317027 - [coro] Make Spill a proper struct instead of deriving from pair.
Benjamin Kramer via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 31 12:22:56 PDT 2017
Author: d0k
Date: Tue Oct 31 12:22:55 2017
New Revision: 317027
URL: http://llvm.org/viewvc/llvm-project?rev=317027&view=rev
Log:
[coro] Make Spill a proper struct instead of deriving from pair.
No functionality change.
Modified:
llvm/trunk/lib/Transforms/Coroutines/CoroFrame.cpp
Modified: llvm/trunk/lib/Transforms/Coroutines/CoroFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Coroutines/CoroFrame.cpp?rev=317027&r1=317026&r2=317027&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Coroutines/CoroFrame.cpp (original)
+++ llvm/trunk/lib/Transforms/Coroutines/CoroFrame.cpp Tue Oct 31 12:22:55 2017
@@ -261,21 +261,19 @@ SuspendCrossingInfo::SuspendCrossingInfo
// 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<Value *, Instruction *> {
- using base = std::pair<Value *, Instruction *>;
-
- Spill(Value *Def, User *U) : base(Def, cast<Instruction>(U)) {}
-
- Value *def() const { return first; }
- Instruction *user() const { return second; }
- BasicBlock *userBlock() const { return second->getParent(); }
-
- std::pair<Value *, BasicBlock *> getKey() const {
- return {def(), userBlock()};
- }
-
- bool operator<(Spill const &rhs) const { return getKey() < rhs.getKey(); }
+namespace {
+class Spill {
+ Value *Def;
+ Instruction *User;
+
+public:
+ Spill(Value *Def, llvm::User *U) : Def(Def), User(cast<Instruction>(U)) {}
+
+ 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.
More information about the llvm-commits
mailing list