Skip to content

Commit

Permalink
Reformat linebreaks.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244430 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
chapuni committed Aug 10, 2015
1 parent 8f38c5f commit e4b461c
Show file tree
Hide file tree
Showing 24 changed files with 42 additions and 45 deletions.
2 changes: 1 addition & 1 deletion include/llvm/ADT/APSInt.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace llvm {

class APSInt : public APInt {
bool IsUnsigned;

public:
/// Default constructor that creates an uninitialized APInt.
explicit APSInt() : IsUnsigned(false) {}
Expand Down Expand Up @@ -246,7 +247,6 @@ class APSInt : public APInt {
return this->operator|(RHS);
}


APSInt operator^(const APSInt& RHS) const {
assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
return APSInt(static_cast<const APInt&>(*this) ^ RHS, IsUnsigned);
Expand Down
3 changes: 3 additions & 0 deletions include/llvm/ADT/DenseSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class DenseSet {
static_assert(sizeof(typename MapTy::value_type) == sizeof(ValueT),
"DenseMap buckets unexpectedly large!");
MapTy TheMap;

public:
typedef ValueT key_type;
typedef ValueT value_type;
Expand Down Expand Up @@ -79,6 +80,7 @@ class DenseSet {
class Iterator {
typename MapTy::iterator I;
friend class DenseSet;

public:
typedef typename MapTy::iterator::difference_type difference_type;
typedef ValueT value_type;
Expand All @@ -99,6 +101,7 @@ class DenseSet {
class ConstIterator {
typename MapTy::const_iterator I;
friend class DenseSet;

public:
typedef typename MapTy::const_iterator::difference_type difference_type;
typedef ValueT value_type;
Expand Down
4 changes: 1 addition & 3 deletions include/llvm/ADT/DepthFirstIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class df_iterator_storage<SetType, true> {
SetType &Visited;
};


// Generic Depth First Iterator
template<class GraphT,
class SetType = llvm::SmallPtrSet<typename GraphTraits<GraphT>::NodeType*, 8>,
Expand All @@ -77,6 +76,7 @@ class df_iterator : public std::iterator<std::forward_iterator_tag,
// First element is node pointer, second is the 'next child' to visit
// if the int in PointerIntTy is 0, the 'next child' to visit is invalid
std::vector<std::pair<PointerIntTy, ChildItTy> > VisitStack;

private:
inline df_iterator(NodeType *Node) {
this->Visited.insert(Node);
Expand Down Expand Up @@ -195,7 +195,6 @@ class df_iterator : public std::iterator<std::forward_iterator_tag,
}
};


// Provide global constructors that automatically figure out correct types...
//
template <class T>
Expand Down Expand Up @@ -237,7 +236,6 @@ iterator_range<df_ext_iterator<T, SetTy>> depth_first_ext(const T& G,
return make_range(df_ext_begin(G, S), df_ext_end(G, S));
}


// Provide global definitions of inverse depth first iterators...
template <class T,
class SetTy = llvm::SmallPtrSet<typename GraphTraits<T>::NodeType*, 8>,
Expand Down
10 changes: 4 additions & 6 deletions include/llvm/ADT/FoldingSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ class FoldingSetImpl {
void *NextInFoldingSetBucket;

public:

Node() : NextInFoldingSetBucket(nullptr) {}

// Accessors
Expand Down Expand Up @@ -182,13 +181,11 @@ class FoldingSetImpl {
bool empty() const { return NumNodes == 0; }

private:

/// GrowHashTable - Double the size of the hash table and rehash everything.
///
void GrowHashTable();

protected:

/// GetNodeProfile - Instantiations of the FoldingSet template implement
/// this function to gather data bits for the given node.
virtual void GetNodeProfile(Node *N, FoldingSetNodeID &ID) const = 0;
Expand Down Expand Up @@ -269,6 +266,7 @@ template<typename T, typename Ctx> struct ContextualFoldingSetTrait
class FoldingSetNodeIDRef {
const unsigned *Data;
size_t Size;

public:
FoldingSetNodeIDRef() : Data(nullptr), Size(0) {}
FoldingSetNodeIDRef(const unsigned *D, size_t S) : Data(D), Size(S) {}
Expand Down Expand Up @@ -498,7 +496,6 @@ class ContextualFoldingSet final : public FoldingSetImpl {

Ctx getContext() const { return Context; }


typedef FoldingSetIterator<T> iterator;
iterator begin() { return iterator(Buckets); }
iterator end() { return iterator(Buckets+NumBuckets); }
Expand Down Expand Up @@ -614,7 +611,6 @@ class FoldingSetIteratorImpl {
}
};


template<class T>
class FoldingSetIterator : public FoldingSetIteratorImpl {
public:
Expand Down Expand Up @@ -666,7 +662,6 @@ class FoldingSetBucketIteratorImpl {
}
};


template<class T>
class FoldingSetBucketIterator : public FoldingSetBucketIteratorImpl {
public:
Expand Down Expand Up @@ -694,6 +689,7 @@ class FoldingSetBucketIterator : public FoldingSetBucketIteratorImpl {
template <typename T>
class FoldingSetNodeWrapper : public FoldingSetNode {
T data;

public:
template <typename... Ts>
explicit FoldingSetNodeWrapper(Ts &&... Args)
Expand All @@ -716,8 +712,10 @@ class FoldingSetNodeWrapper : public FoldingSetNode {
/// information that would otherwise only be required for recomputing an ID.
class FastFoldingSetNode : public FoldingSetNode {
FoldingSetNodeID FastID;

protected:
explicit FastFoldingSetNode(const FoldingSetNodeID &ID) : FastID(ID) {}

public:
void Profile(FoldingSetNodeID &ID) const {
ID.AddNodeID(FastID);
Expand Down
1 change: 0 additions & 1 deletion include/llvm/ADT/ImmutableMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ struct ImutKeyValueInfo {
}
};


template <typename KeyT, typename ValT,
typename ValInfo = ImutKeyValueInfo<KeyT,ValT> >
class ImmutableMap {
Expand Down
1 change: 1 addition & 0 deletions include/llvm/ADT/PointerIntPair.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class PointerIntPair {
// ShiftedIntMask - This is the bits for the integer shifted in place.
ShiftedIntMask = (uintptr_t)(IntMask << IntShift)
};

public:
PointerIntPair() : Value(0) {}
PointerIntPair(PointerTy PtrVal, IntType IntVal) {
Expand Down
9 changes: 5 additions & 4 deletions include/llvm/ADT/ScopedHashTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class ScopedHashTableVal {
K Key;
V Val;
ScopedHashTableVal(const K &key, const V &val) : Key(key), Val(val) {}
public:

public:
const K &getKey() const { return Key; }
const V &getValue() const { return Val; }
V &getValue() { return Val; }
Expand Down Expand Up @@ -92,6 +92,7 @@ class ScopedHashTableScope {
ScopedHashTableVal<K, V> *LastValInScope;
void operator=(ScopedHashTableScope&) = delete;
ScopedHashTableScope(ScopedHashTableScope&) = delete;

public:
ScopedHashTableScope(ScopedHashTable<K, V, KInfo, AllocatorTy> &HT);
~ScopedHashTableScope();
Expand All @@ -109,10 +110,10 @@ class ScopedHashTableScope {
}
};


template <typename K, typename V, typename KInfo = DenseMapInfo<K> >
class ScopedHashTableIterator {
ScopedHashTableVal<K, V> *Node;

public:
ScopedHashTableIterator(ScopedHashTableVal<K, V> *node) : Node(node) {}

Expand Down Expand Up @@ -141,14 +142,14 @@ class ScopedHashTableIterator {
}
};


template <typename K, typename V, typename KInfo, typename AllocatorTy>
class ScopedHashTable {
public:
/// ScopeTy - This is a helpful typedef that allows clients to get easy access
/// to the name of the scope for this hash table.
typedef ScopedHashTableScope<K, V, KInfo, AllocatorTy> ScopeTy;
typedef unsigned size_type;

private:
typedef ScopedHashTableVal<K, V> ValTy;
DenseMap<K, ValTy*, KInfo> TopLevelMap;
Expand All @@ -159,13 +160,13 @@ class ScopedHashTable {
ScopedHashTable(const ScopedHashTable&); // NOT YET IMPLEMENTED
void operator=(const ScopedHashTable&); // NOT YET IMPLEMENTED
friend class ScopedHashTableScope<K, V, KInfo, AllocatorTy>;

public:
ScopedHashTable() : CurScope(nullptr) {}
ScopedHashTable(AllocatorTy A) : CurScope(0), Allocator(A) {}
~ScopedHashTable() {
assert(!CurScope && TopLevelMap.empty() && "Scope imbalance!");
}


/// Access to the allocator.
AllocatorTy &getAllocator() { return Allocator; }
Expand Down
1 change: 0 additions & 1 deletion include/llvm/ADT/SetVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ class SetVector {
return true;
}


/// \brief Count the number of elements of a given key in the SetVector.
/// \returns 0 if the element is not in the SetVector, 1 if it is.
size_type count(const key_type &key) const {
Expand Down
7 changes: 5 additions & 2 deletions include/llvm/ADT/SmallPtrSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class SmallPtrSetIteratorImpl;
///
class SmallPtrSetImplBase {
friend class SmallPtrSetIteratorImpl;

protected:
/// SmallArray - Points to a fixed size set of buckets, used in 'small mode'.
const void **SmallArray;
Expand Down Expand Up @@ -133,6 +134,7 @@ class SmallPtrSetImplBase {
void Grow(unsigned NewSize);

void operator=(const SmallPtrSetImplBase &RHS) = delete;

protected:
/// swap - Swaps the elements of two sets.
/// Note: This method assumes that both sets have the same small size.
Expand All @@ -148,6 +150,7 @@ class SmallPtrSetIteratorImpl {
protected:
const void *const *Bucket;
const void *const *End;

public:
explicit SmallPtrSetIteratorImpl(const void *const *BP, const void*const *E)
: Bucket(BP), End(E) {
Expand Down Expand Up @@ -231,7 +234,6 @@ template<unsigned N>
struct RoundUpToPowerOfTwo {
enum { Val = RoundUpToPowerOfTwoH<N, (N&(N-1)) == 0>::Val };
};


/// \brief A templated base class for \c SmallPtrSet which provides the
/// typesafe interface that is common across all small sizes.
Expand All @@ -243,6 +245,7 @@ class SmallPtrSetImpl : public SmallPtrSetImplBase {
typedef PointerLikeTypeTraits<PtrType> PtrTraits;

SmallPtrSetImpl(const SmallPtrSetImpl&) = delete;

protected:
// Constructors that forward to the base.
SmallPtrSetImpl(const void **SmallStorage, const SmallPtrSetImpl &that)
Expand Down Expand Up @@ -303,6 +306,7 @@ class SmallPtrSet : public SmallPtrSetImpl<PtrType> {
enum { SmallSizePowTwo = RoundUpToPowerOfTwo<SmallSize>::Val };
/// SmallStorage - Fixed size storage used in 'small mode'.
const void *SmallStorage[SmallSizePowTwo];

public:
SmallPtrSet() : BaseT(SmallStorage, SmallSizePowTwo) {}
SmallPtrSet(const SmallPtrSet &that) : BaseT(SmallStorage, that) {}
Expand Down Expand Up @@ -333,7 +337,6 @@ class SmallPtrSet : public SmallPtrSetImpl<PtrType> {
SmallPtrSetImplBase::swap(RHS);
}
};

}

namespace std {
Expand Down
2 changes: 2 additions & 0 deletions include/llvm/ADT/SmallSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class SmallSet {
std::set<T, C> Set;
typedef typename SmallVector<T, N>::const_iterator VIterator;
typedef typename SmallVector<T, N>::iterator mutable_iterator;

public:
typedef size_t size_type;
SmallSet() {}
Expand Down Expand Up @@ -108,6 +109,7 @@ class SmallSet {
Vector.clear();
Set.clear();
}

private:
bool isSmall() const { return Set.empty(); }

Expand Down
10 changes: 7 additions & 3 deletions include/llvm/ADT/StringMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ namespace llvm {
/// StringMapEntryBase - Shared base class of StringMapEntry instances.
class StringMapEntryBase {
unsigned StrLen;

public:
explicit StringMapEntryBase(unsigned Len) : StrLen(Len) {}

Expand All @@ -48,6 +49,7 @@ class StringMapImpl {
unsigned NumItems;
unsigned NumTombstones;
unsigned ItemSize;

protected:
explicit StringMapImpl(unsigned itemSize)
: TheTable(nullptr),
Expand Down Expand Up @@ -85,8 +87,10 @@ class StringMapImpl {
/// RemoveKey - Remove the StringMapEntry for the specified key from the
/// table, returning it. If the key is not in the table, this returns null.
StringMapEntryBase *RemoveKey(StringRef Key);

private:
void init(unsigned Size);

public:
static StringMapEntryBase *getTombstoneVal() {
return (StringMapEntryBase*)-1;
Expand All @@ -112,6 +116,7 @@ class StringMapImpl {
template<typename ValueTy>
class StringMapEntry : public StringMapEntryBase {
StringMapEntry(StringMapEntry &E) = delete;

public:
ValueTy second;

Expand Down Expand Up @@ -205,14 +210,14 @@ class StringMapEntry : public StringMapEntryBase {
}
};


/// StringMap - This is an unconventional map that is specialized for handling
/// keys that are "strings", which are basically ranges of bytes. This does some
/// funky memory allocation and hashing things to make it extremely efficient,
/// storing the string data *after* the value in the map.
template<typename ValueTy, typename AllocatorTy = MallocAllocator>
class StringMap : public StringMapImpl {
AllocatorTy Allocator;

public:
typedef StringMapEntry<ValueTy> MapEntryTy;

Expand Down Expand Up @@ -386,11 +391,11 @@ class StringMap : public StringMapImpl {
}
};


template<typename ValueTy>
class StringMapConstIterator {
protected:
StringMapEntryBase **Ptr;

public:
typedef StringMapEntry<ValueTy> value_type;

Expand Down Expand Up @@ -447,7 +452,6 @@ class StringMapIterator : public StringMapConstIterator<ValueTy> {
return static_cast<StringMapEntry<ValueTy>*>(*this->Ptr);
}
};

}

#endif
1 change: 0 additions & 1 deletion include/llvm/ADT/TinyPtrVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ class TinyPtrVector {
return Val.getAddrOfPtr1();

return Val.template get<VecTy *>()->begin();

}
iterator end() {
if (Val.template is<EltTy>())
Expand Down
Loading

0 comments on commit e4b461c

Please sign in to comment.