[llvm-commits] [llvm] r49901 - in /llvm/branches/ggreif/use-diet/include/llvm: Use.h Value.h
Gabor Greif
ggreif at gmail.com
Fri Apr 18 07:30:42 PDT 2008
Author: ggreif
Date: Fri Apr 18 09:30:41 2008
New Revision: 49901
URL: http://llvm.org/viewvc/llvm-project?rev=49901&view=rev
Log:
Use::Val no more tagged, interface simplified
Modified:
llvm/branches/ggreif/use-diet/include/llvm/Use.h
llvm/branches/ggreif/use-diet/include/llvm/Value.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=49901&r1=49900&r2=49901&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:30:41 2008
@@ -93,8 +93,8 @@
public:
- operator Value*() const { return stripTag(Val); }
- Value *get() const { return stripTag(Val); }
+ operator Value*() const { return Val; }
+ Value *get() const { return Val; }
User *getUser() const;
const Use* getImpliedUser() const;
static Use *initTags(Use *Start, Use *Stop, ptrdiff_t Done = 0);
@@ -111,30 +111,24 @@
return *this;
}
- Value *operator->() { return stripTag(Val); }
- const Value *operator->() const { return stripTag(Val); }
+ Value *operator->() { return Val; }
+ const Value *operator->() const { return Val; }
Use *getNext() const { return Next; }
private:
Value *Val;
Use *Next, **Prev;
- static Value *stripTag(Value *V) {
- return llvm::stripTag<fullStopTag>(V);
- }
- Value *transferTag(Value *V) {
- return llvm::transferTag<fullStopTag>(Val, V);
- }
void addToList(Use **List) {
Next = *List;
- if (Next) Next->Prev = llvm::transferTag<fullStopTag>(Next->Prev, &Next);
- Prev = llvm::transferTag<fullStopTag>(Prev, List);
+ if (Next) Next->Prev = transferTag<fullStopTag>(Next->Prev, &Next);
+ Prev = transferTag<fullStopTag>(Prev, List);
*List = this;
}
void removeFromList() {
- Use **StrippedPrev = llvm::stripTag<fullStopTag>(Prev);
+ Use **StrippedPrev = stripTag<fullStopTag>(Prev);
*StrippedPrev = Next;
- if (Next) Next->Prev = llvm::transferTag<fullStopTag>(Next->Prev, StrippedPrev);
+ if (Next) Next->Prev = transferTag<fullStopTag>(Next->Prev, StrippedPrev);
}
friend class Value;
Modified: llvm/branches/ggreif/use-diet/include/llvm/Value.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Value.h?rev=49901&r1=49900&r2=49901&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/include/llvm/Value.h (original)
+++ llvm/branches/ggreif/use-diet/include/llvm/Value.h Fri Apr 18 09:30:41 2008
@@ -224,13 +224,13 @@
}
void Use::init(Value *V, User *user) {
- Val = transferTag(V);
+ Val = V;
if (V) V->addUse(*this);
}
void Use::set(Value *V) {
- if (stripTag(Val)) removeFromList();
- Val = transferTag(V);
+ if (Val) removeFromList();
+ Val = V;
if (V) V->addUse(*this);
}
More information about the llvm-commits
mailing list