mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-12 13:30:51 +00:00
Simplify User::operator delete().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124330 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1fe3aa15e9
commit
adede0387b
@ -53,6 +53,7 @@ protected:
|
||||
void dropHungoffUses() {
|
||||
Use::zap(OperandList, OperandList + NumOperands, true);
|
||||
OperandList = 0;
|
||||
// Reset NumOperands so User::operator delete() does the right thing.
|
||||
NumOperands = 0;
|
||||
}
|
||||
public:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user