diff options
author | Jay Foad <jay.foad@gmail.com> | 2011-01-26 21:56:10 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2011-01-26 21:56:10 +0000 |
commit | b0c5e35929f9965db3bd8b38c9b766faac7590fe (patch) | |
tree | 0d35d418ec7d40de0fea33fad1c112d45f9b7be5 /llvm/lib/VMCore/User.cpp | |
parent | 770681d7b67f4aa7078aacf1cb165a83ead94526 (diff) | |
download | bcm5719-llvm-b0c5e35929f9965db3bd8b38c9b766faac7590fe.tar.gz bcm5719-llvm-b0c5e35929f9965db3bd8b38c9b766faac7590fe.zip |
Simplify User::operator delete().
llvm-svn: 124330
Diffstat (limited to 'llvm/lib/VMCore/User.cpp')
-rw-r--r-- | llvm/lib/VMCore/User.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/llvm/lib/VMCore/User.cpp b/llvm/lib/VMCore/User.cpp index ba2b2081db5..2f4587debb6 100644 --- a/llvm/lib/VMCore/User.cpp +++ b/llvm/lib/VMCore/User.cpp @@ -73,16 +73,9 @@ void *User::operator new(size_t s, unsigned Us) { void User::operator delete(void *Usr) { User *Start = static_cast<User*>(Usr); Use *Storage = static_cast<Use*>(Usr) - Start->NumOperands; - // - // look for a variadic User - if (Storage == Start->OperandList) { - ::operator delete(Storage); - return; - } - // - // in all other cases just delete the nullary User (covers hung-off - // uses also - ::operator delete(Usr); + // If there were hung-off uses, they will have been freed already and + // NumOperands reset to 0, so here we just free the User itself. + ::operator delete(Storage); } } // End llvm namespace |