mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-20 14:29:27 +00:00
Improve adherence to general style, use "foo_t &x" instead of "foo_t& x"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130153 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e27c3ea2bc
commit
6311a55b9d
@ -209,10 +209,10 @@ template<typename T> struct FoldingSetTrait;
|
|||||||
/// for FoldingSetTrait implementations.
|
/// for FoldingSetTrait implementations.
|
||||||
///
|
///
|
||||||
template<typename T> struct DefaultFoldingSetTrait {
|
template<typename T> struct DefaultFoldingSetTrait {
|
||||||
static void Profile(const T& X, FoldingSetNodeID& ID) {
|
static void Profile(const T &X, FoldingSetNodeID &ID) {
|
||||||
X.Profile(ID);
|
X.Profile(ID);
|
||||||
}
|
}
|
||||||
static void Profile(T& X, FoldingSetNodeID& ID) {
|
static void Profile(T &X, FoldingSetNodeID &ID) {
|
||||||
X.Profile(ID);
|
X.Profile(ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -267,7 +267,7 @@ template<typename T, typename Ctx> struct ContextualFoldingSetTrait
|
|||||||
/// is often much larger than necessary, and the possibility of heap
|
/// is often much larger than necessary, and the possibility of heap
|
||||||
/// allocation means it requires a non-trivial destructor call.
|
/// allocation means it requires a non-trivial destructor call.
|
||||||
class FoldingSetNodeIDRef {
|
class FoldingSetNodeIDRef {
|
||||||
const unsigned* Data;
|
const unsigned *Data;
|
||||||
size_t Size;
|
size_t Size;
|
||||||
public:
|
public:
|
||||||
FoldingSetNodeIDRef() : Data(0), Size(0) {}
|
FoldingSetNodeIDRef() : Data(0), Size(0) {}
|
||||||
@ -313,7 +313,7 @@ public:
|
|||||||
void AddNodeID(const FoldingSetNodeID &ID);
|
void AddNodeID(const FoldingSetNodeID &ID);
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline void Add(const T& x) { FoldingSetTrait<T>::Profile(x, *this); }
|
inline void Add(const T &x) { FoldingSetTrait<T>::Profile(x, *this); }
|
||||||
|
|
||||||
/// clear - Clear the accumulated profile, allowing this FoldingSetNodeID
|
/// clear - Clear the accumulated profile, allowing this FoldingSetNodeID
|
||||||
/// object to be used to compute a new profile.
|
/// object to be used to compute a new profile.
|
||||||
@ -549,7 +549,7 @@ public:
|
|||||||
return static_cast<T*>(NodePtr);
|
return static_cast<T*>(NodePtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline FoldingSetIterator& operator++() { // Preincrement
|
inline FoldingSetIterator &operator++() { // Preincrement
|
||||||
advance();
|
advance();
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -597,10 +597,10 @@ public:
|
|||||||
FoldingSetBucketIterator(void **Bucket, bool) :
|
FoldingSetBucketIterator(void **Bucket, bool) :
|
||||||
FoldingSetBucketIteratorImpl(Bucket, true) {}
|
FoldingSetBucketIteratorImpl(Bucket, true) {}
|
||||||
|
|
||||||
T& operator*() const { return *static_cast<T*>(Ptr); }
|
T &operator*() const { return *static_cast<T*>(Ptr); }
|
||||||
T* operator->() const { return static_cast<T*>(Ptr); }
|
T *operator->() const { return static_cast<T*>(Ptr); }
|
||||||
|
|
||||||
inline FoldingSetBucketIterator& operator++() { // Preincrement
|
inline FoldingSetBucketIterator &operator++() { // Preincrement
|
||||||
advance();
|
advance();
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -616,36 +616,36 @@ template <typename T>
|
|||||||
class FoldingSetNodeWrapper : public FoldingSetNode {
|
class FoldingSetNodeWrapper : public FoldingSetNode {
|
||||||
T data;
|
T data;
|
||||||
public:
|
public:
|
||||||
explicit FoldingSetNodeWrapper(const T& x) : data(x) {}
|
explicit FoldingSetNodeWrapper(const T &x) : data(x) {}
|
||||||
virtual ~FoldingSetNodeWrapper() {}
|
virtual ~FoldingSetNodeWrapper() {}
|
||||||
|
|
||||||
template<typename A1>
|
template<typename A1>
|
||||||
explicit FoldingSetNodeWrapper(const A1& a1)
|
explicit FoldingSetNodeWrapper(const A1 &a1)
|
||||||
: data(a1) {}
|
: data(a1) {}
|
||||||
|
|
||||||
template <typename A1, typename A2>
|
template <typename A1, typename A2>
|
||||||
explicit FoldingSetNodeWrapper(const A1& a1, const A2& a2)
|
explicit FoldingSetNodeWrapper(const A1 &a1, const A2 &a2)
|
||||||
: data(a1,a2) {}
|
: data(a1,a2) {}
|
||||||
|
|
||||||
template <typename A1, typename A2, typename A3>
|
template <typename A1, typename A2, typename A3>
|
||||||
explicit FoldingSetNodeWrapper(const A1& a1, const A2& a2, const A3& a3)
|
explicit FoldingSetNodeWrapper(const A1 &a1, const A2 &a2, const A3 &a3)
|
||||||
: data(a1,a2,a3) {}
|
: data(a1,a2,a3) {}
|
||||||
|
|
||||||
template <typename A1, typename A2, typename A3, typename A4>
|
template <typename A1, typename A2, typename A3, typename A4>
|
||||||
explicit FoldingSetNodeWrapper(const A1& a1, const A2& a2, const A3& a3,
|
explicit FoldingSetNodeWrapper(const A1 &a1, const A2 &a2, const A3 &a3,
|
||||||
const A4& a4)
|
const A4 &a4)
|
||||||
: data(a1,a2,a3,a4) {}
|
: data(a1,a2,a3,a4) {}
|
||||||
|
|
||||||
template <typename A1, typename A2, typename A3, typename A4, typename A5>
|
template <typename A1, typename A2, typename A3, typename A4, typename A5>
|
||||||
explicit FoldingSetNodeWrapper(const A1& a1, const A2& a2, const A3& a3,
|
explicit FoldingSetNodeWrapper(const A1 &a1, const A2 &a2, const A3 &a3,
|
||||||
const A4& a4, const A5& a5)
|
const A4 &a4, const A5 &a5)
|
||||||
: data(a1,a2,a3,a4,a5) {}
|
: data(a1,a2,a3,a4,a5) {}
|
||||||
|
|
||||||
|
|
||||||
void Profile(FoldingSetNodeID &ID) { FoldingSetTrait<T>::Profile(data, ID); }
|
void Profile(FoldingSetNodeID &ID) { FoldingSetTrait<T>::Profile(data, ID); }
|
||||||
|
|
||||||
T& getValue() { return data; }
|
T &getValue() { return data; }
|
||||||
const T& getValue() const { return data; }
|
const T &getValue() const { return data; }
|
||||||
|
|
||||||
operator T&() { return data; }
|
operator T&() { return data; }
|
||||||
operator const T&() const { return data; }
|
operator const T&() const { return data; }
|
||||||
@ -662,7 +662,7 @@ class FastFoldingSetNode : public FoldingSetNode {
|
|||||||
protected:
|
protected:
|
||||||
explicit FastFoldingSetNode(const FoldingSetNodeID &ID) : FastID(ID) {}
|
explicit FastFoldingSetNode(const FoldingSetNodeID &ID) : FastID(ID) {}
|
||||||
public:
|
public:
|
||||||
void Profile(FoldingSetNodeID& ID) const {
|
void Profile(FoldingSetNodeID &ID) const {
|
||||||
ID.AddNodeID(FastID);
|
ID.AddNodeID(FastID);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -671,13 +671,13 @@ public:
|
|||||||
// Partial specializations of FoldingSetTrait.
|
// Partial specializations of FoldingSetTrait.
|
||||||
|
|
||||||
template<typename T> struct FoldingSetTrait<T*> {
|
template<typename T> struct FoldingSetTrait<T*> {
|
||||||
static inline void Profile(const T* X, FoldingSetNodeID& ID) {
|
static inline void Profile(const T *X, FoldingSetNodeID &ID) {
|
||||||
ID.AddPointer(X);
|
ID.AddPointer(X);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T> struct FoldingSetTrait<const T*> {
|
template<typename T> struct FoldingSetTrait<const T*> {
|
||||||
static inline void Profile(const T* X, FoldingSetNodeID& ID) {
|
static inline void Profile(const T *X, FoldingSetNodeID &ID) {
|
||||||
ID.AddPointer(X);
|
ID.AddPointer(X);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user