[llvm-commits] [llvm] r123623 - in /llvm/trunk: include/llvm/Use.h lib/VMCore/Use.cpp lib/VMCore/User.cpp
Jay Foad
jay.foad at gmail.com
Mon Jan 17 07:18:06 PST 2011
Author: foad
Date: Mon Jan 17 09:18:06 2011
New Revision: 123623
URL: http://llvm.org/viewvc/llvm-project?rev=123623&view=rev
Log:
Remove useless Tag enumeration.
Modified:
llvm/trunk/include/llvm/Use.h
llvm/trunk/lib/VMCore/Use.cpp
llvm/trunk/lib/VMCore/User.cpp
Modified: llvm/trunk/include/llvm/Use.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Use.h?rev=123623&r1=123622&r2=123623&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Use.h (original)
+++ llvm/trunk/include/llvm/Use.h Mon Jan 17 09:18:06 2011
@@ -25,9 +25,7 @@
#ifndef LLVM_USE_H
#define LLVM_USE_H
-#include "llvm/Support/Casting.h"
#include "llvm/ADT/PointerIntPair.h"
-#include <cstddef>
#include <iterator>
namespace llvm {
@@ -36,9 +34,6 @@
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<Use**> {
@@ -71,10 +66,10 @@
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 @@
//===----------------------------------------------------------------------===//
struct AugmentedUse : public Use {
- PointerIntPair<User*, 1, Tag> ref;
+ PointerIntPair<User*, 1, unsigned> ref;
AugmentedUse(); // not implemented
};
Modified: llvm/trunk/lib/VMCore/Use.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Use.cpp?rev=123623&r1=123622&r2=123623&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Use.cpp (original)
+++ llvm/trunk/lib/VMCore/Use.cpp Mon Jan 17 09:18:06 2011
@@ -135,8 +135,8 @@
User *Use::getUser() const {
const Use *End = getImpliedUser();
- const PointerIntPair<User*, 1, Tag>& ref(
- static_cast<const AugmentedUse*>(End - 1)->ref);
+ const PointerIntPair<User*, 1, unsigned>&
+ ref(static_cast<const AugmentedUse*>(End - 1)->ref);
User *She = ref.getPointer();
return ref.getInt()
? She
Modified: llvm/trunk/lib/VMCore/User.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/User.cpp?rev=123623&r1=123622&r2=123623&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/User.cpp (original)
+++ llvm/trunk/lib/VMCore/User.cpp Mon Jan 17 09:18:06 2011
@@ -44,9 +44,10 @@
+ sizeof(AugmentedUse)
- sizeof(Use)));
Use *End = Begin + N;
- PointerIntPair<User*, 1, Tag>& ref(static_cast<AugmentedUse&>(End[-1]).ref);
+ PointerIntPair<User*, 1, unsigned>&
+ ref(static_cast<AugmentedUse&>(End[-1]).ref);
ref.setPointer(const_cast<User*>(this));
- ref.setInt(tagOne);
+ ref.setInt(1);
return Use::initTags(Begin, End);
}
More information about the llvm-commits
mailing list