aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/User.cpp
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2015-06-12 17:48:05 +0000
committerPete Cooper <peter_cooper@apple.com>2015-06-12 17:48:05 +0000
commit74510a409dcef1a8f102f4a2accb9a61b37c738a (patch)
tree80b88ddbd1d977a8c8e354fcaf0d341773351016 /llvm/lib/IR/User.cpp
parent726ce7fc571a511f628736ba94ee113334ee3e60 (diff)
downloadllvm-74510a409dcef1a8f102f4a2accb9a61b37c738a.zip
llvm-74510a409dcef1a8f102f4a2accb9a61b37c738a.tar.gz
llvm-74510a409dcef1a8f102f4a2accb9a61b37c738a.tar.bz2
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. llvm-svn: 239620
Diffstat (limited to 'llvm/lib/IR/User.cpp')
-rw-r--r--llvm/lib/IR/User.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/IR/User.cpp b/llvm/lib/IR/User.cpp
index d659352..0cba526 100644
--- a/llvm/lib/IR/User.cpp
+++ b/llvm/lib/IR/User.cpp
@@ -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);