aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/User.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2011-06-20 14:12:33 +0000
committerJay Foad <jay.foad@gmail.com>2011-06-20 14:12:33 +0000
commit691c05bb29d3e2ec9c2ed6b1c082ce5d484b75da (patch)
tree5f6500ab6343f4316365cd6795fcd2044c9ba0f6 /lib/VMCore/User.cpp
parent689c24768bce1a3bf33b47559e9398525d11142d (diff)
Remove the AugmentedUse struct.
I don't think the AugmentedUse struct buys us much, either in correctness or in ease of use. Ditch it, and simplify Use::getUser() and User::allocHungoffUses(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133433 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/User.cpp')
-rw-r--r--lib/VMCore/User.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/VMCore/User.cpp b/lib/VMCore/User.cpp
index 2f4587debb..9601da7011 100644
--- a/lib/VMCore/User.cpp
+++ b/lib/VMCore/User.cpp
@@ -41,13 +41,9 @@ void User::replaceUsesOfWith(Value *From, Value *To) {
Use *User::allocHungoffUses(unsigned N) const {
Use *Begin = static_cast<Use*>(::operator new(sizeof(Use) * N
- + sizeof(AugmentedUse)
- - sizeof(Use)));
+ + sizeof(Use::UserRef)));
Use *End = Begin + N;
- PointerIntPair<User*, 1, unsigned>&
- ref(static_cast<AugmentedUse&>(End[-1]).ref);
- ref.setPointer(const_cast<User*>(this));
- ref.setInt(1);
+ (void) new(End) Use::UserRef(const_cast<User*>(this), 1);
return Use::initTags(Begin, End);
}