From 599c83ed66477770ccb14e8389661dcc48f2a2e2 Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Mon, 17 Jan 2011 15:18:06 +0000 Subject: [PATCH] Remove useless Tag enumeration. llvm-svn: 123623 --- include/llvm/Use.h | 15 +++++---------- lib/VMCore/Use.cpp | 4 ++-- lib/VMCore/User.cpp | 5 +++-- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/include/llvm/Use.h b/include/llvm/Use.h index 1b8f48921ed..96e07f88940 100644 --- a/include/llvm/Use.h +++ b/include/llvm/Use.h @@ -25,9 +25,7 @@ #ifndef LLVM_USE_H #define LLVM_USE_H -#include "llvm/Support/Casting.h" #include "llvm/ADT/PointerIntPair.h" -#include #include namespace llvm { @@ -36,9 +34,6 @@ class Value; class User; class Use; -/// Tag - generic tag type for (at least 32 bit) pointers -enum Tag { noTag, tagOne, tagTwo, tagThree }; - // Use** is only 4-byte aligned. template<> class PointerLikeTypeTraits { @@ -71,10 +66,10 @@ private: if (Val) removeFromList(); } - enum PrevPtrTag { zeroDigitTag = noTag - , oneDigitTag = tagOne - , stopTag = tagTwo - , fullStopTag = tagThree }; + enum PrevPtrTag { zeroDigitTag + , oneDigitTag + , stopTag + , fullStopTag }; /// Constructor Use(PrevPtrTag tag) : Val(0) { @@ -215,7 +210,7 @@ public: //===----------------------------------------------------------------------===// struct AugmentedUse : public Use { - PointerIntPair ref; + PointerIntPair ref; AugmentedUse(); // not implemented }; diff --git a/lib/VMCore/Use.cpp b/lib/VMCore/Use.cpp index 4e959a516cd..2258b8d985a 100644 --- a/lib/VMCore/Use.cpp +++ b/lib/VMCore/Use.cpp @@ -135,8 +135,8 @@ void Use::zap(Use *Start, const Use *Stop, bool del) { User *Use::getUser() const { const Use *End = getImpliedUser(); - const PointerIntPair& ref( - static_cast(End - 1)->ref); + const PointerIntPair& + ref(static_cast(End - 1)->ref); User *She = ref.getPointer(); return ref.getInt() ? She diff --git a/lib/VMCore/User.cpp b/lib/VMCore/User.cpp index 153eb34e090..ba2b2081db5 100644 --- a/lib/VMCore/User.cpp +++ b/lib/VMCore/User.cpp @@ -44,9 +44,10 @@ Use *User::allocHungoffUses(unsigned N) const { + sizeof(AugmentedUse) - sizeof(Use))); Use *End = Begin + N; - PointerIntPair& ref(static_cast(End[-1]).ref); + PointerIntPair& + ref(static_cast(End[-1]).ref); ref.setPointer(const_cast(this)); - ref.setInt(tagOne); + ref.setInt(1); return Use::initTags(Begin, End); }