mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 00:20:11 +00:00
Replace all accesses to User::OperandList with getter and setter methods. NFC.
We don't want anyone to access OperandList directly as its going to be removed and computed instead. This uses getter's and setter's instead in which we can later change the underlying implementation of OperandList. Reviewed by Duncan Exon Smith. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239620 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
+4
-4
@@ -49,7 +49,7 @@ void User::allocHungoffUses(unsigned N, bool IsPhi) {
|
||||
Use *Begin = static_cast<Use*>(::operator new(size));
|
||||
Use *End = Begin + N;
|
||||
(void) new(End) Use::UserRef(const_cast<User*>(this), 1);
|
||||
OperandList = Use::initTags(Begin, End);
|
||||
setOperandList(Use::initTags(Begin, End));
|
||||
// Tag this operand list as being a hung off.
|
||||
HasHungOffUses = true;
|
||||
}
|
||||
@@ -63,9 +63,9 @@ void User::growHungoffUses(unsigned NewNumUses, bool IsPhi) {
|
||||
// space to copy the old uses in to the new space.
|
||||
assert(NewNumUses > OldNumUses && "realloc must grow num uses");
|
||||
|
||||
Use *OldOps = OperandList;
|
||||
Use *OldOps = getOperandList();
|
||||
allocHungoffUses(NewNumUses, IsPhi);
|
||||
Use *NewOps = OperandList;
|
||||
Use *NewOps = getOperandList();
|
||||
|
||||
// Now copy from the old operands list to the new one.
|
||||
std::copy(OldOps, OldOps + OldNumUses, NewOps);
|
||||
@@ -90,7 +90,7 @@ void *User::operator new(size_t s, unsigned Us) {
|
||||
Use *Start = static_cast<Use*>(Storage);
|
||||
Use *End = Start + Us;
|
||||
User *Obj = reinterpret_cast<User*>(End);
|
||||
Obj->OperandList = Start;
|
||||
Obj->setOperandList(Start);
|
||||
Obj->HasHungOffUses = false;
|
||||
Obj->NumOperands = Us;
|
||||
Use::initTags(Start, End);
|
||||
|
||||
Reference in New Issue
Block a user