1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

Remove use of reserved identifier and some excess 'inline' usage

llvm-svn: 232309
This commit is contained in:
David Blaikie 2015-03-15 03:11:26 +00:00
parent 60a1bdcf4c
commit 9b68e6accb

View File

@ -293,8 +293,8 @@ private:
height = h; height = h;
} }
static inline static uint32_t computeDigest(ImutAVLTree *L, ImutAVLTree *R,
uint32_t computeDigest(ImutAVLTree* L, ImutAVLTree* R, value_type_ref V) { value_type_ref V) {
uint32_t digest = 0; uint32_t digest = 0;
if (L) if (L)
@ -311,7 +311,7 @@ private:
return digest; return digest;
} }
inline uint32_t computeDigest() { uint32_t computeDigest() {
// Check the lowest bit to determine if digest has actually been // Check the lowest bit to determine if digest has actually been
// pre-computed. // pre-computed.
if (hasCachedDigest()) if (hasCachedDigest())
@ -429,9 +429,7 @@ protected:
value_type_ref getValue(TreeTy* T) const { return T->value; } value_type_ref getValue(TreeTy* T) const { return T->value; }
// Make sure the index is not the Tombstone or Entry key of the DenseMap. // Make sure the index is not the Tombstone or Entry key of the DenseMap.
static inline unsigned maskCacheIndex(unsigned I) { static unsigned maskCacheIndex(unsigned I) { return (I & ~0x02); }
return (I & ~0x02);
}
unsigned incrementHeight(TreeTy* L, TreeTy* R) const { unsigned incrementHeight(TreeTy* L, TreeTy* R) const {
unsigned hl = getHeight(L); unsigned hl = getHeight(L);
@ -654,10 +652,10 @@ public:
Flags=0x3 }; Flags=0x3 };
typedef ImutAVLTree<ImutInfo> TreeTy; typedef ImutAVLTree<ImutInfo> TreeTy;
typedef ImutAVLTreeGenericIterator<ImutInfo> _Self; typedef ImutAVLTreeGenericIterator<ImutInfo> ImutAVLTreeGenericIterator;
inline ImutAVLTreeGenericIterator() {} ImutAVLTreeGenericIterator() {}
inline ImutAVLTreeGenericIterator(const TreeTy* Root) { ImutAVLTreeGenericIterator(const TreeTy *Root) {
if (Root) stack.push_back(reinterpret_cast<uintptr_t>(Root)); if (Root) stack.push_back(reinterpret_cast<uintptr_t>(Root));
} }
@ -695,13 +693,15 @@ public:
} }
} }
inline bool operator==(const _Self& x) const { bool operator==(const ImutAVLTreeGenericIterator &x) const {
return stack == x.stack; return stack == x.stack;
} }
inline bool operator!=(const _Self& x) const { return !operator==(x); } bool operator!=(const ImutAVLTreeGenericIterator &x) const {
return !(*this == x);
}
_Self& operator++() { ImutAVLTreeGenericIterator &operator++() {
assert(!stack.empty()); assert(!stack.empty());
TreeTy* Current = reinterpret_cast<TreeTy*>(stack.back() & ~Flags); TreeTy* Current = reinterpret_cast<TreeTy*>(stack.back() & ~Flags);
assert(Current); assert(Current);
@ -727,7 +727,7 @@ public:
return *this; return *this;
} }
_Self& operator--() { ImutAVLTreeGenericIterator &operator--() {
assert(!stack.empty()); assert(!stack.empty());
TreeTy* Current = reinterpret_cast<TreeTy*>(stack.back() & ~Flags); TreeTy* Current = reinterpret_cast<TreeTy*>(stack.back() & ~Flags);
assert(Current); assert(Current);
@ -760,24 +760,27 @@ class ImutAVLTreeInOrderIterator {
public: public:
typedef ImutAVLTree<ImutInfo> TreeTy; typedef ImutAVLTree<ImutInfo> TreeTy;
typedef ImutAVLTreeInOrderIterator<ImutInfo> _Self; typedef ImutAVLTreeInOrderIterator<ImutInfo> ImutAVLTreeGenericIterator;
ImutAVLTreeInOrderIterator(const TreeTy* Root) : InternalItr(Root) { ImutAVLTreeInOrderIterator(const TreeTy* Root) : InternalItr(Root) {
if (Root) operator++(); // Advance to first element. if (Root)
++*this; // Advance to first element.
} }
ImutAVLTreeInOrderIterator() : InternalItr() {} ImutAVLTreeInOrderIterator() : InternalItr() {}
inline bool operator==(const _Self& x) const { bool operator==(const ImutAVLTreeGenericIterator &x) const {
return InternalItr == x.InternalItr; return InternalItr == x.InternalItr;
} }
inline bool operator!=(const _Self& x) const { return !operator==(x); } bool operator!=(const ImutAVLTreeGenericIterator &x) const {
return !(*this == x);
}
inline TreeTy* operator*() const { return *InternalItr; } TreeTy *operator*() const { return *InternalItr; }
inline TreeTy* operator->() const { return *InternalItr; } TreeTy *operator->() const { return *InternalItr; }
inline _Self& operator++() { ImutAVLTreeGenericIterator &operator++() {
do ++InternalItr; do ++InternalItr;
while (!InternalItr.atEnd() && while (!InternalItr.atEnd() &&
InternalItr.getVisitState() != InternalIteratorTy::VisitedLeft); InternalItr.getVisitState() != InternalIteratorTy::VisitedLeft);
@ -785,7 +788,7 @@ public:
return *this; return *this;
} }
inline _Self& operator--() { ImutAVLTreeGenericIterator &operator--() {
do --InternalItr; do --InternalItr;
while (!InternalItr.atBeginning() && while (!InternalItr.atBeginning() &&
InternalItr.getVisitState() != InternalIteratorTy::VisitedLeft); InternalItr.getVisitState() != InternalIteratorTy::VisitedLeft);
@ -793,7 +796,7 @@ public:
return *this; return *this;
} }
inline void skipSubTree() { void skipSubTree() {
InternalItr.skipToParent(); InternalItr.skipToParent();
while (!InternalItr.atEnd() && while (!InternalItr.atEnd() &&
@ -814,7 +817,7 @@ struct ImutProfileInfo {
typedef const T value_type; typedef const T value_type;
typedef const T& value_type_ref; typedef const T& value_type_ref;
static inline void Profile(FoldingSetNodeID& ID, value_type_ref X) { static void Profile(FoldingSetNodeID &ID, value_type_ref X) {
FoldingSetTrait<T>::Profile(X,ID); FoldingSetTrait<T>::Profile(X,ID);
} }
}; };
@ -825,7 +828,7 @@ struct ImutProfileInteger {
typedef const T value_type; typedef const T value_type;
typedef const T& value_type_ref; typedef const T& value_type_ref;
static inline void Profile(FoldingSetNodeID& ID, value_type_ref X) { static void Profile(FoldingSetNodeID &ID, value_type_ref X) {
ID.AddInteger(X); ID.AddInteger(X);
} }
}; };
@ -852,7 +855,7 @@ struct ImutProfileInfo<bool> {
typedef const bool value_type; typedef const bool value_type;
typedef const bool& value_type_ref; typedef const bool& value_type_ref;
static inline void Profile(FoldingSetNodeID& ID, value_type_ref X) { static void Profile(FoldingSetNodeID &ID, value_type_ref X) {
ID.AddBoolean(X); ID.AddBoolean(X);
} }
}; };
@ -865,7 +868,7 @@ struct ImutProfileInfo<T*> {
typedef const T* value_type; typedef const T* value_type;
typedef value_type value_type_ref; typedef value_type value_type_ref;
static inline void Profile(FoldingSetNodeID &ID, value_type_ref X) { static void Profile(FoldingSetNodeID &ID, value_type_ref X) {
ID.AddPointer(X); ID.AddPointer(X);
} }
}; };
@ -890,18 +893,18 @@ struct ImutContainerInfo : public ImutProfileInfo<T> {
typedef bool data_type; typedef bool data_type;
typedef bool data_type_ref; typedef bool data_type_ref;
static inline key_type_ref KeyOfValue(value_type_ref D) { return D; } static key_type_ref KeyOfValue(value_type_ref D) { return D; }
static inline data_type_ref DataOfValue(value_type_ref) { return true; } static data_type_ref DataOfValue(value_type_ref) { return true; }
static inline bool isEqual(key_type_ref LHS, key_type_ref RHS) { static bool isEqual(key_type_ref LHS, key_type_ref RHS) {
return std::equal_to<key_type>()(LHS,RHS); return std::equal_to<key_type>()(LHS,RHS);
} }
static inline bool isLess(key_type_ref LHS, key_type_ref RHS) { static bool isLess(key_type_ref LHS, key_type_ref RHS) {
return std::less<key_type>()(LHS,RHS); return std::less<key_type>()(LHS,RHS);
} }
static inline bool isDataEqual(data_type_ref,data_type_ref) { return true; } static bool isDataEqual(data_type_ref, data_type_ref) { return true; }
}; };
/// ImutContainerInfo - Specialization for pointer values to treat pointers /// ImutContainerInfo - Specialization for pointer values to treat pointers
@ -916,18 +919,14 @@ struct ImutContainerInfo<T*> : public ImutProfileInfo<T*> {
typedef bool data_type; typedef bool data_type;
typedef bool data_type_ref; typedef bool data_type_ref;
static inline key_type_ref KeyOfValue(value_type_ref D) { return D; } static key_type_ref KeyOfValue(value_type_ref D) { return D; }
static inline data_type_ref DataOfValue(value_type_ref) { return true; } static data_type_ref DataOfValue(value_type_ref) { return true; }
static inline bool isEqual(key_type_ref LHS, key_type_ref RHS) { static bool isEqual(key_type_ref LHS, key_type_ref RHS) { return LHS == RHS; }
return LHS == RHS;
}
static inline bool isLess(key_type_ref LHS, key_type_ref RHS) { static bool isLess(key_type_ref LHS, key_type_ref RHS) { return LHS < RHS; }
return LHS < RHS;
}
static inline bool isDataEqual(data_type_ref,data_type_ref) { return true; } static bool isDataEqual(data_type_ref, data_type_ref) { return true; }
}; };
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
@ -1074,7 +1073,7 @@ public:
typedef std::bidirectional_iterator_tag iterator_category; typedef std::bidirectional_iterator_tag iterator_category;
typename iterator::reference operator*() const { return itr->getValue(); } typename iterator::reference operator*() const { return itr->getValue(); }
typename iterator::pointer operator->() const { return &(operator*()); } typename iterator::pointer operator->() const { return &**this; }
iterator& operator++() { ++itr; return *this; } iterator& operator++() { ++itr; return *this; }
iterator operator++(int) { iterator tmp(*this); ++itr; return tmp; } iterator operator++(int) { iterator tmp(*this); ++itr; return tmp; }
@ -1094,13 +1093,11 @@ public:
unsigned getHeight() const { return Root ? Root->getHeight() : 0; } unsigned getHeight() const { return Root ? Root->getHeight() : 0; }
static inline void Profile(FoldingSetNodeID& ID, const ImmutableSet& S) { static void Profile(FoldingSetNodeID &ID, const ImmutableSet &S) {
ID.AddPointer(S.Root); ID.AddPointer(S.Root);
} }
inline void Profile(FoldingSetNodeID& ID) const { void Profile(FoldingSetNodeID &ID) const { return Profile(ID, *this); }
return Profile(ID,*this);
}
//===--------------------------------------------------===// //===--------------------------------------------------===//
// For testing. // For testing.
@ -1150,7 +1147,7 @@ public:
if (Root) { Root->release(); } if (Root) { Root->release(); }
} }
static inline ImmutableSetRef getEmptySet(FactoryTy *F) { static ImmutableSetRef getEmptySet(FactoryTy *F) {
return ImmutableSetRef(0, F); return ImmutableSetRef(0, F);
} }
@ -1201,14 +1198,28 @@ public:
friend class ImmutableSetRef<ValT,ValInfo>; friend class ImmutableSetRef<ValT,ValInfo>;
public: public:
iterator() {} iterator() {}
inline value_type_ref operator*() const { return itr->getValue(); } value_type_ref operator*() const { return itr->getValue(); }
inline iterator& operator++() { ++itr; return *this; } iterator &operator++() {
inline iterator operator++(int) { iterator tmp(*this); ++itr; return tmp; } ++itr;
inline iterator& operator--() { --itr; return *this; } return *this;
inline iterator operator--(int) { iterator tmp(*this); --itr; return tmp; } }
inline bool operator==(const iterator& RHS) const { return RHS.itr == itr; } iterator operator++(int) {
inline bool operator!=(const iterator& RHS) const { return RHS.itr != itr; } iterator tmp(*this);
inline value_type *operator->() const { return &(operator*()); } ++itr;
return tmp;
}
iterator &operator--() {
--itr;
return *this;
}
iterator operator--(int) {
iterator tmp(*this);
--itr;
return tmp;
}
bool operator==(const iterator &RHS) const { return RHS.itr == itr; }
bool operator!=(const iterator &RHS) const { return RHS.itr != itr; }
value_type *operator->() const { return &**this; }
}; };
iterator begin() const { return iterator(Root); } iterator begin() const { return iterator(Root); }
@ -1220,13 +1231,11 @@ public:
unsigned getHeight() const { return Root ? Root->getHeight() : 0; } unsigned getHeight() const { return Root ? Root->getHeight() : 0; }
static inline void Profile(FoldingSetNodeID& ID, const ImmutableSetRef& S) { static void Profile(FoldingSetNodeID &ID, const ImmutableSetRef &S) {
ID.AddPointer(S.Root); ID.AddPointer(S.Root);
} }
inline void Profile(FoldingSetNodeID& ID) const { void Profile(FoldingSetNodeID &ID) const { return Profile(ID, *this); }
return Profile(ID,*this);
}
//===--------------------------------------------------===// //===--------------------------------------------------===//
// For testing. // For testing.