diff options
author | Gabor Greif <ggreif@gmail.com> | 2008-09-19 15:13:20 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2008-09-19 15:13:20 +0000 |
commit | 8be491b7709c4c36b6849a618e6bf8e96fceb670 (patch) | |
tree | 55a17319586a5d0b4c6c2a2596b594e0eed5a35c /lib/VMCore/Use.cpp | |
parent | a7e3013a8ed559b17367e82788a1c52c13ee134d (diff) | |
download | external_llvm-8be491b7709c4c36b6849a618e6bf8e96fceb670.zip external_llvm-8be491b7709c4c36b6849a618e6bf8e96fceb670.tar.gz external_llvm-8be491b7709c4c36b6849a618e6bf8e96fceb670.tar.bz2 |
backing out my last commit, it was not intended to go on the trunk
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56349 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Use.cpp')
-rw-r--r-- | lib/VMCore/Use.cpp | 43 |
1 files changed, 9 insertions, 34 deletions
diff --git a/lib/VMCore/Use.cpp b/lib/VMCore/Use.cpp index 3cdf347..d96a0e5 100644 --- a/lib/VMCore/Use.cpp +++ b/lib/VMCore/Use.cpp @@ -20,31 +20,8 @@ namespace llvm { //===----------------------------------------------------------------------===// void Use::swap(Use &RHS) { - ptrdiff_t dist((char*)&RHS - (char*)this); - - if (dist) { - Use *valid1(stripTag<tagMaskN>(Next)); - Use *valid2(stripTag<tagMaskN>(RHS.Next)); - if (valid1 && valid2) { - bool real1(fullStopTagN != extractTag<NextPtrTag, tagMaskN>(Next)); - bool real2(fullStopTagN != extractTag<NextPtrTag, tagMaskN>(RHS.Next)); - (char*&)*stripTag<tagMask>(Prev) += dist; - (char*&)*stripTag<tagMask>(RHS.Prev) -= dist; - if (real1) - (char*&)valid1->Next += dist; - if (real2) - (char*&)valid2->Next -= dist; - - } - - // swap the members - std::swap(Next, RHS.Next); - Use** Prev1 = transferTag<tagMask>(Prev, stripTag<tagMask>(RHS.Prev)); - RHS.Prev = transferTag<tagMask>(RHS.Prev, stripTag<tagMask>(Prev)); - Prev = Prev1; - } - /* Value *V1(Val1); - Value *V2(RHS.Val1); + Value *V1(Val); + Value *V2(RHS.Val); if (V1 != V2) { if (V1) { removeFromList(); @@ -52,20 +29,19 @@ void Use::swap(Use &RHS) { if (V2) { RHS.removeFromList(); - Val1 = V2; + Val = V2; V2->addUse(*this); } else { - Val1 = 0; + Val = 0; } if (V1) { - RHS.Val1 = V1; + RHS.Val = V1; V1->addUse(RHS); } else { - RHS.Val1 = 0; + RHS.Val = 0; } } - */ } //===----------------------------------------------------------------------===// @@ -76,7 +52,7 @@ const Use *Use::getImpliedUser() const { const Use *Current = this; while (true) { - unsigned Tag = extractTag<PrevPtrTag, tagMask>((Current++)->Prev); + unsigned Tag = extractTag<PrevPtrTag, fullStopTag>((Current++)->Prev); switch (Tag) { case zeroDigitTag: case oneDigitTag: @@ -86,7 +62,7 @@ const Use *Use::getImpliedUser() const { ++Current; ptrdiff_t Offset = 1; while (true) { - unsigned Tag = extractTag<PrevPtrTag, tagMask>(Current->Prev); + unsigned Tag = extractTag<PrevPtrTag, fullStopTag>(Current->Prev); switch (Tag) { case zeroDigitTag: case oneDigitTag: @@ -113,8 +89,7 @@ Use *Use::initTags(Use * const Start, Use *Stop, ptrdiff_t Done) { ptrdiff_t Count = Done; while (Start != Stop) { --Stop; - Stop->Val1 = 0; - Stop->Next = nilUse(0); + Stop->Val = 0; if (!Count) { Stop->Prev = reinterpret_cast<Use**>(Done == 0 ? fullStopTag : stopTag); ++Done; |