[llvm-commits] [llvm] r49902 - /llvm/branches/ggreif/use-diet/include/llvm/Use.h
Gabor Greif
ggreif at gmail.com
Fri Apr 18 07:48:22 PDT 2008
Author: ggreif
Date: Fri Apr 18 09:48:22 2008
New Revision: 49902
URL: http://llvm.org/viewvc/llvm-project?rev=49902&view=rev
Log:
simplify tagging logic by introducing private helper
Modified:
llvm/branches/ggreif/use-diet/include/llvm/Use.h
Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Use.h?rev=49902&r1=49901&r2=49902&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/include/llvm/Use.h (original)
+++ llvm/branches/ggreif/use-diet/include/llvm/Use.h Fri Apr 18 09:48:22 2008
@@ -119,16 +119,19 @@
Value *Val;
Use *Next, **Prev;
+ void setPrev(Use **NewPrev) {
+ Prev = transferTag<fullStopTag>(Prev, NewPrev);
+ }
void addToList(Use **List) {
Next = *List;
- if (Next) Next->Prev = transferTag<fullStopTag>(Next->Prev, &Next);
- Prev = transferTag<fullStopTag>(Prev, List);
+ if (Next) Next->setPrev(&Next);
+ setPrev(List);
*List = this;
}
void removeFromList() {
Use **StrippedPrev = stripTag<fullStopTag>(Prev);
*StrippedPrev = Next;
- if (Next) Next->Prev = transferTag<fullStopTag>(Next->Prev, StrippedPrev);
+ if (Next) Next->setPrev(StrippedPrev);
}
friend class Value;
More information about the llvm-commits
mailing list