diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2017-10-31 19:22:55 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2017-10-31 19:22:55 +0000 |
commit | 992fc4ea2de587f73684c4a17d1c27eecbc9afb5 (patch) | |
tree | 2d9f30cd0c6923798609906122004464390a61b8 /llvm/lib/Transforms/Coroutines | |
parent | 95c142e20841dee86316025a597210194a0b8948 (diff) | |
download | bcm5719-llvm-992fc4ea2de587f73684c4a17d1c27eecbc9afb5.tar.gz bcm5719-llvm-992fc4ea2de587f73684c4a17d1c27eecbc9afb5.zip |
[coro] Make Spill a proper struct instead of deriving from pair.
No functionality change.
llvm-svn: 317027
Diffstat (limited to 'llvm/lib/Transforms/Coroutines')
-rw-r--r-- | llvm/lib/Transforms/Coroutines/CoroFrame.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp index d192fa699f3..6334256bf03 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<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(); } +namespace { +class Spill { + Value *Def; + Instruction *User; - std::pair<Value *, BasicBlock *> getKey() const { - return {def(), userBlock()}; - } +public: + Spill(Value *Def, llvm::User *U) : Def(Def), User(cast<Instruction>(U)) {} - 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. |