#define LLVM_ADT_DAGDELTAALGORITHM_H
#include <set>
+#include <utility>
#include <vector>
namespace llvm {
/// should satisfy.
class DAGDeltaAlgorithm {
virtual void anchor();
+
public:
typedef unsigned change_ty;
typedef std::pair<change_ty, change_ty> edge_ty;
typedef std::vector<changeset_ty> changesetlist_ty;
public:
- virtual ~DAGDeltaAlgorithm() {}
+ virtual ~DAGDeltaAlgorithm() = default;
/// Run - Minimize the DAG formed by the \p Changes vertices and the
/// \p Dependencies edges by executing \see ExecuteOneTest() on subsets of
} // end namespace llvm
-#endif
+#endif // LLVM_ADT_DAGDELTAALGORITHM_H
#define LLVM_ADT_DEPTHFIRSTITERATOR_H
#include "llvm/ADT/GraphTraits.h"
+#include "llvm/ADT/None.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/iterator_range.h"
+#include <iterator>
#include <set>
+#include <utility>
#include <vector>
namespace llvm {
public:
df_iterator_storage(SetType &VSet) : Visited(VSet) {}
df_iterator_storage(const df_iterator_storage &S) : Visited(S.Visited) {}
+
SetType &Visited;
};
// node have been processed. It is intended to distinguish of back and
// cross edges in the spanning tree but is not used in the common case.
template <typename NodeRef, unsigned SmallSize=8>
-struct df_iterator_default_set : public llvm::SmallPtrSet<NodeRef, SmallSize> {
- typedef llvm::SmallPtrSet<NodeRef, SmallSize> BaseSet;
+struct df_iterator_default_set : public SmallPtrSet<NodeRef, SmallSize> {
+ typedef SmallPtrSet<NodeRef, SmallSize> BaseSet;
typedef typename BaseSet::iterator iterator;
std::pair<iterator,bool> insert(NodeRef N) { return BaseSet::insert(N) ; }
template <typename IterT>
this->Visited.insert(Node);
VisitStack.push_back(StackElement(Node, None));
}
- inline df_iterator() {
- // End is when stack is empty
- }
+ inline df_iterator() = default; // End is when stack is empty
inline df_iterator(NodeRef Node, SetType &S)
: df_iterator_storage<SetType, ExtStorage>(S) {
if (this->Visited.insert(Node).second)
return make_range(idf_ext_begin(G, S), idf_ext_end(G, S));
}
-} // End llvm namespace
+} // end namespace llvm
-#endif
+#endif // LLVM_ADT_DEPTHFIRSTITERATOR_H
#ifndef LLVM_ADT_EQUIVALENCECLASSES_H
#define LLVM_ADT_EQUIVALENCECLASSES_H
-#include "llvm/Support/DataTypes.h"
#include <cassert>
#include <cstddef>
+#include <cstdint>
+#include <iterator>
#include <set>
namespace llvm {
friend class EquivalenceClasses;
mutable const ECValue *Leader, *Next;
ElemTy Data;
+
// ECValue ctor - Start out with EndOfList pointing to this node, Next is
// Null, isLeader = true.
ECValue(const ElemTy &Elt)
// Path compression.
return Leader = Leader->getLeader();
}
+
const ECValue *getEndOfList() const {
assert(isLeader() && "Cannot get the end of a list for a non-leader!");
return Leader;
assert(getNext() == nullptr && "Already has a next pointer!");
Next = (const ECValue*)((intptr_t)NewNext | (intptr_t)isLeader());
}
+
public:
ECValue(const ECValue &RHS) : Leader(this), Next((ECValue*)(intptr_t)1),
Data(RHS.Data) {
std::set<ECValue> TheMapping;
public:
- EquivalenceClasses() {}
+ EquivalenceClasses() = default;
EquivalenceClasses(const EquivalenceClasses &RHS) {
operator=(RHS);
}
return NC;
}
-
//===--------------------------------------------------------------------===//
// Mutation methods
return findLeader(TheMapping.find(V));
}
-
/// union - Merge the two equivalence sets for the specified values, inserting
/// them if they do not already exist in the equivalence set.
member_iterator unionSets(const ElemTy &V1, const ElemTy &V2) {
const ElemTy, ptrdiff_t> super;
const ECValue *Node;
friend class EquivalenceClasses;
+
public:
typedef size_t size_type;
typedef typename super::pointer pointer;
typedef typename super::reference reference;
- explicit member_iterator() {}
+ explicit member_iterator() = default;
explicit member_iterator(const ECValue *N) : Node(N) {}
reference operator*() const {
};
};
-} // End llvm namespace
+} // end namespace llvm
-#endif
+#endif // LLVM_ADT_EQUIVALENCECLASSES_H
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/iterator.h"
#include "llvm/Support/Allocator.h"
+#include <cassert>
+#include <cstddef>
+#include <cstdint>
+#include <utility>
namespace llvm {
+
/// This folding set used for two purposes:
/// 1. Given information about a node we want to create, look up the unique
/// instance of the node in the set. If the node already exists, return
/// EltCount-th node won't cause a rebucket operation. reserve is permitted
/// to allocate more space than requested by EltCount.
void reserve(unsigned EltCount);
+
/// capacity - Returns the number of nodes permitted in the folding set
/// before a rebucket operation is performed.
unsigned capacity() {
/// NewBucketCount must be a power of two, and must be greater than the old
/// bucket count.
void GrowBucketCount(unsigned NewBucketCount);
+
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;
+
/// NodeEquals - Instantiations of the FoldingSet template implement
/// this function to compare the given node with the given ID.
virtual bool NodeEquals(Node *N, const FoldingSetNodeID &ID, unsigned IDHash,
FoldingSetNodeID &TempID) const=0;
+
/// ComputeNodeHash - Instantiations of the FoldingSet template implement
/// this function to compute a hash value for the given node.
virtual unsigned ComputeNodeHash(Node *N, FoldingSetNodeID &TempID) const = 0;
//===----------------------------------------------------------------------===//
-template<typename T> struct FoldingSetTrait;
-
/// DefaultFoldingSetTrait - This class provides default implementations
/// for FoldingSetTrait implementations.
///
template<typename T> struct FoldingSetTrait
: public DefaultFoldingSetTrait<T> {};
-template<typename T, typename Ctx> struct ContextualFoldingSetTrait;
-
/// DefaultContextualFoldingSetTrait - Like DefaultFoldingSetTrait, but
/// for ContextualFoldingSets.
template<typename T, typename Ctx>
static void Profile(T &X, FoldingSetNodeID &ID, Ctx Context) {
X.Profile(ID, Context);
}
+
static inline bool Equals(T &X, const FoldingSetNodeID &ID, unsigned IDHash,
FoldingSetNodeID &TempID, Ctx Context);
static inline unsigned ComputeHash(T &X, FoldingSetNodeID &TempID,
/// is often much larger than necessary, and the possibility of heap
/// allocation means it requires a non-trivial destructor call.
class FoldingSetNodeIDRef {
- const unsigned *Data;
- size_t Size;
+ const unsigned *Data = nullptr;
+ size_t Size = 0;
public:
- FoldingSetNodeIDRef() : Data(nullptr), Size(0) {}
+ FoldingSetNodeIDRef() = default;
FoldingSetNodeIDRef(const unsigned *D, size_t S) : Data(D), Size(S) {}
/// ComputeHash - Compute a strong hash value for this FoldingSetNodeIDRef,
SmallVector<unsigned, 32> Bits;
public:
- FoldingSetNodeID() {}
+ FoldingSetNodeID() = default;
FoldingSetNodeID(FoldingSetNodeIDRef Ref)
: Bits(Ref.getData(), Ref.getData() + Ref.getSize()) {}
T *TN = static_cast<T *>(N);
FoldingSetTrait<T>::Profile(*TN, ID);
}
+
/// NodeEquals - Instantiations may optionally provide a way to compare a
/// node with a specified ID.
bool NodeEquals(Node *N, const FoldingSetNodeID &ID, unsigned IDHash,
T *TN = static_cast<T *>(N);
return FoldingSetTrait<T>::Equals(*TN, ID, IDHash, TempID);
}
+
/// ComputeNodeHash - Instantiations may optionally provide a way to compute a
/// hash value directly from a node.
unsigned ComputeNodeHash(Node *N, FoldingSetNodeID &TempID) const override {
///
/// T must be a subclass of FoldingSetNode and implement a Profile
/// function with signature
-/// void Profile(llvm::FoldingSetNodeID &, Ctx);
+/// void Profile(FoldingSetNodeID &, Ctx);
template <class T, class Ctx>
class ContextualFoldingSet final : public FoldingSetImpl {
// Unfortunately, this can't derive from FoldingSet<T> because the
T *TN = static_cast<T *>(N);
ContextualFoldingSetTrait<T, Ctx>::Profile(*TN, ID, Context);
}
+
bool NodeEquals(FoldingSetImpl::Node *N, const FoldingSetNodeID &ID,
unsigned IDHash, FoldingSetNodeID &TempID) const override {
T *TN = static_cast<T *>(N);
return ContextualFoldingSetTrait<T, Ctx>::Equals(*TN, ID, IDHash, TempID,
Context);
}
+
unsigned ComputeNodeHash(FoldingSetImpl::Node *N,
FoldingSetNodeID &TempID) const override {
T *TN = static_cast<T *>(N);
/// to provide the interface of FoldingSet but with deterministic iteration
/// order based on the insertion order. T must be a subclass of FoldingSetNode
/// and implement a Profile function.
-template <class T, class VectorT = SmallVector<T*, 8> >
+template <class T, class VectorT = SmallVector<T*, 8>>
class FoldingSetVector {
FoldingSet<T> Set;
VectorT Vector;
class FoldingSetIteratorImpl {
protected:
FoldingSetNode *NodePtr;
+
FoldingSetIteratorImpl(void **Bucket);
+
void advance();
public:
template <typename T1, typename T2>
struct FoldingSetTrait<std::pair<T1, T2>> {
static inline void Profile(const std::pair<T1, T2> &P,
- llvm::FoldingSetNodeID &ID) {
+ FoldingSetNodeID &ID) {
ID.Add(P.first);
ID.Add(P.second);
}
};
-} // End of namespace llvm.
-#endif
+} // end namespace llvm
+
+#endif // LLVM_ADT_FOLDINGSET_H
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/FoldingSet.h"
+#include "llvm/ADT/iterator.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Allocator.h"
-#include "llvm/Support/DataTypes.h"
#include "llvm/Support/ErrorHandling.h"
#include <cassert>
#include <functional>
#include <vector>
+#include <cstdint>
+#include <iterator>
+#include <new>
namespace llvm {
public:
void retain() { ++refCount; }
+
void release() {
assert(refCount > 0);
if (--refCount == 0)
destroy();
}
+
void destroy() {
if (left)
left->release();
std::vector<TreeTy*> freeNodes;
bool ownsAllocator() const {
- return Allocator & 0x1 ? false : true;
+ return (Allocator & 0x1) == 0;
}
BumpPtrAllocator& getAllocator() const {
TreeTy* getEmptyTree() const { return nullptr; }
protected:
-
//===--------------------------------------------------===//
// A bunch of quick helper functions used for reasoning
// about the properties of trees and their children.
: public std::iterator<std::bidirectional_iterator_tag,
ImutAVLTree<ImutInfo>> {
SmallVector<uintptr_t,20> stack;
+
public:
enum VisitFlag { VisitedNone=0x0, VisitedLeft=0x1, VisitedRight=0x3,
Flags=0x3 };
typedef ImutAVLTree<ImutInfo> TreeTy;
- ImutAVLTreeGenericIterator() {}
+ ImutAVLTreeGenericIterator() = default;
ImutAVLTreeGenericIterator(const TreeTy *Root) {
if (Root) stack.push_back(reinterpret_cast<uintptr_t>(Root));
}
return stack.back() & Flags;
}
-
bool atEnd() const { return stack.empty(); }
bool atBeginning() const {
}
};
-
/// Generic profile trait for pointer types. We treat pointers as
/// references to unique objects.
template <typename T>
// for element profiling.
//===----------------------------------------------------------------------===//
-
/// ImutContainerInfo - Generic definition of comparison operations for
/// elements of immutable containers that defaults to using
/// std::equal_to<> and std::less<> to perform comparison of elements.
// Immutable Set
//===----------------------------------------------------------------------===//
-template <typename ValT, typename ValInfo = ImutContainerInfo<ValT> >
+template <typename ValT, typename ValInfo = ImutContainerInfo<ValT>>
class ImmutableSet {
public:
typedef typename ValInfo::value_type value_type;
explicit ImmutableSet(TreeTy* R) : Root(R) {
if (Root) { Root->retain(); }
}
+
ImmutableSet(const ImmutableSet &X) : Root(X.Root) {
if (Root) { Root->retain(); }
}
+
ImmutableSet &operator=(const ImmutableSet &X) {
if (Root != X.Root) {
if (X.Root) { X.Root->retain(); }
}
return *this;
}
+
~ImmutableSet() {
if (Root) { Root->release(); }
}
Factory(BumpPtrAllocator& Alloc, bool canonicalize = true)
: F(Alloc), Canonicalize(canonicalize) {}
+ Factory(const Factory& RHS) = delete;
+ void operator=(const Factory& RHS) = delete;
+
/// getEmptySet - Returns an immutable set that contains no elements.
ImmutableSet getEmptySet() {
return ImmutableSet(F.getEmptyTree());
typename TreeTy::Factory *getTreeFactory() const {
return const_cast<typename TreeTy::Factory *>(&F);
}
-
- private:
- Factory(const Factory& RHS) = delete;
- void operator=(const Factory& RHS) = delete;
};
friend class Factory;
};
// NOTE: This may some day replace the current ImmutableSet.
-template <typename ValT, typename ValInfo = ImutContainerInfo<ValT> >
+template <typename ValT, typename ValInfo = ImutContainerInfo<ValT>>
class ImmutableSetRef {
public:
typedef typename ValInfo::value_type value_type;
Factory(F) {
if (Root) { Root->retain(); }
}
+
ImmutableSetRef(const ImmutableSetRef &X)
: Root(X.Root),
Factory(X.Factory) {
if (Root) { Root->retain(); }
}
+
ImmutableSetRef &operator=(const ImmutableSetRef &X) {
if (Root != X.Root) {
if (X.Root) { X.Root->retain(); }
} // end namespace llvm
-#endif
+#endif // LLVM_ADT_IMMUTABLESET_H
#include "llvm/Support/AlignOf.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/RecyclingAllocator.h"
+#include <algorithm>
+#include <cassert>
#include <iterator>
+#include <new>
+#include <utility>
namespace llvm {
-
//===----------------------------------------------------------------------===//
//--- Key traits ---//
//===----------------------------------------------------------------------===//
template <typename T>
struct IntervalMapInfo {
-
/// startLess - Return true if x is not in [a;b].
/// This is x < a both for closed intervals and for [a;b) half-open intervals.
static inline bool startLess(const T &x, const T &a) {
static inline bool nonEmpty(const T &a, const T &b) {
return a <= b;
}
-
};
template <typename T>
struct IntervalMapHalfOpenInfo {
-
/// startLess - Return true if x is not in [a;b).
static inline bool startLess(const T &x, const T &a) {
return x < a;
static inline bool nonEmpty(const T &a, const T &b) {
return a < b;
}
-
};
/// IntervalMapImpl - Namespace used for IntervalMap implementation details.
/// It should be considered private to the implementation.
namespace IntervalMapImpl {
-// Forward declarations.
-template <typename, typename, unsigned, typename> class LeafNode;
-template <typename, typename, unsigned, typename> class BranchNode;
-
typedef std::pair<unsigned,unsigned> IdxPair;
-
//===----------------------------------------------------------------------===//
//--- IntervalMapImpl::NodeBase ---//
//===----------------------------------------------------------------------===//
const unsigned *CurSize, unsigned NewSize[],
unsigned Position, bool Grow);
-
//===----------------------------------------------------------------------===//
//--- IntervalMapImpl::NodeSizer ---//
//===----------------------------------------------------------------------===//
/// different kinds of maps.
typedef RecyclingAllocator<BumpPtrAllocator, char,
AllocBytes, CacheLineBytes> Allocator;
-
};
-
//===----------------------------------------------------------------------===//
//--- IntervalMapImpl::NodeRef ---//
//===----------------------------------------------------------------------===//
public:
/// NodeRef - Create a null ref.
- NodeRef() {}
+ NodeRef() = default;
/// operator bool - Detect a null ref.
explicit operator bool() const { return pip.getOpaqueValue(); }
return Size + 1;
}
-
//===----------------------------------------------------------------------===//
//--- IntervalMapImpl::BranchNode ---//
//===----------------------------------------------------------------------===//
}
};
-} // namespace IntervalMapImpl
-
+} // end namespace IntervalMapImpl
//===----------------------------------------------------------------------===//
//--- IntervalMap ----//
template <typename KeyT, typename ValT,
unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize,
- typename Traits = IntervalMapInfo<KeyT> >
+ typename Traits = IntervalMapInfo<KeyT>>
class IntervalMap {
typedef IntervalMapImpl::NodeSizer<KeyT, ValT> Sizer;
typedef IntervalMapImpl::LeafNode<KeyT, ValT, Sizer::LeafSize, Traits> Leaf;
assert(!branched() && "Cannot acces leaf data in branched root");
return dataAs<RootLeaf>();
}
+
RootBranchData &rootBranchData() const {
assert(branched() && "Cannot access branch data in non-branched root");
return dataAs<RootBranchData>();
assert(branched() && "Cannot access branch data in non-branched root");
return dataAs<RootBranchData>();
}
+
const RootBranch &rootBranch() const { return rootBranchData().node; }
RootBranch &rootBranch() { return rootBranchData().node; }
KeyT rootBranchStart() const { return rootBranchData().start; }
return NR.get<Leaf>().safeLookup(x, NotFound);
}
-
// branchRoot - Switch from a leaf root to a branched root.
// Return the new (root offset, node offset) corresponding to Position.
template <typename KeyT, typename ValT, unsigned N, typename Traits>
template <typename KeyT, typename ValT, unsigned N, typename Traits>
class IntervalMap<KeyT, ValT, N, Traits>::const_iterator :
public std::iterator<std::bidirectional_iterator_tag, ValT> {
+
protected:
friend class IntervalMap;
path.leafOffset() =
map->rootLeaf().findFrom(path.leafOffset(), map->rootSize, x);
}
-
};
/// pathFillFind - Complete path by searching for x.
public:
/// iterator - Create null iterator.
- iterator() {}
+ iterator() = default;
/// setStart - Move the start of the current interval.
/// This may cause coalescing with the previous interval.
operator--();
return tmp;
}
-
};
/// canCoalesceLeft - Can the current interval coalesce to the left after
treeInsert(a, b, y);
}
-
template <typename KeyT, typename ValT, unsigned N, typename Traits>
void IntervalMap<KeyT, ValT, N, Traits>::
iterator::treeInsert(KeyT a, KeyT b, ValT y) {
}
};
-} // namespace llvm
+} // end namespace llvm
-#endif
+#endif // LLVM_ADT_INTERVALMAP_H
namespace llvm {
- template <class T>
- class IntrusiveRefCntPtr;
-
//===----------------------------------------------------------------------===//
/// RefCountedBase - A generic base class for objects that wish to
/// have their lifetimes managed using reference counts. Classes
//===----------------------------------------------------------------------===//
template <class Derived>
class RefCountedBase {
- mutable unsigned ref_cnt;
+ mutable unsigned ref_cnt = 0;
public:
- RefCountedBase() : ref_cnt(0) {}
+ RefCountedBase() = default;
RefCountedBase(const RefCountedBase &) : ref_cnt(0) {}
void Retain() const { ++ref_cnt; }
/// attempting to do this will produce a compile error.
//===----------------------------------------------------------------------===//
class RefCountedBaseVPTR {
- mutable unsigned ref_cnt;
+ mutable unsigned ref_cnt = 0;
+
virtual void anchor();
protected:
- RefCountedBaseVPTR() : ref_cnt(0) {}
+ RefCountedBaseVPTR() = default;
RefCountedBaseVPTR(const RefCountedBaseVPTR &) : ref_cnt(0) {}
- virtual ~RefCountedBaseVPTR() {}
+ virtual ~RefCountedBaseVPTR() = default;
void Retain() const { ++ref_cnt; }
void Release() const {
//===----------------------------------------------------------------------===//
template <typename T>
class IntrusiveRefCntPtr {
- T* Obj;
+ T* Obj = nullptr;
public:
typedef T element_type;
- explicit IntrusiveRefCntPtr() : Obj(nullptr) {}
+ explicit IntrusiveRefCntPtr() = default;
IntrusiveRefCntPtr(T* obj) : Obj(obj) {
retain();
template <typename From> struct simplify_type;
- template<class T> struct simplify_type<IntrusiveRefCntPtr<T> > {
+ template<class T> struct simplify_type<IntrusiveRefCntPtr<T>> {
typedef T* SimpleType;
static SimpleType getSimplifiedValue(IntrusiveRefCntPtr<T>& Val) {
return Val.get();
}
};
- template<class T> struct simplify_type<const IntrusiveRefCntPtr<T> > {
+ template<class T> struct simplify_type<const IntrusiveRefCntPtr<T>> {
typedef /*const*/ T* SimpleType;
static SimpleType getSimplifiedValue(const IntrusiveRefCntPtr<T>& Val) {
return Val.get();
#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/ADT/PointerIntPair.h"
-#include "llvm/Support/Compiler.h"
+#include "llvm/Support/PointerLikeTypeTraits.h"
+#include <cassert>
+#include <cstdint>
+#include <cstddef>
namespace llvm {
public:
static inline void *getAsVoidPointer(void *P) { return P; }
static inline void *getFromVoidPointer(void *P) { return P; }
+
enum {
PT1BitsAv = (int)(PointerLikeTypeTraits<PT1>::NumLowBitsAvailable),
PT2BitsAv = (int)(PointerLikeTypeTraits<PT2>::NumLowBitsAvailable),
template <typename T> struct UNION_DOESNT_CONTAIN_TYPE {};
public:
- PointerUnion() {}
+ PointerUnion() = default;
PointerUnion(PT1 V)
: Val(const_cast<void *>(
static inline void *getAsVoidPointer(const PointerUnion<PT1, PT2> &P) {
return P.getOpaqueValue();
}
+
static inline PointerUnion<PT1, PT2> getFromVoidPointer(void *P) {
return PointerUnion<PT1, PT2>::getFromOpaqueValue(P);
}
};
public:
- PointerUnion3() {}
+ PointerUnion3() = default;
PointerUnion3(PT1 V) { Val = InnerUnion(V); }
PointerUnion3(PT2 V) { Val = InnerUnion(V); }
static inline void *getAsVoidPointer(const PointerUnion3<PT1, PT2, PT3> &P) {
return P.getOpaqueValue();
}
+
static inline PointerUnion3<PT1, PT2, PT3> getFromVoidPointer(void *P) {
return PointerUnion3<PT1, PT2, PT3>::getFromOpaqueValue(P);
}
ValTy Val;
public:
- PointerUnion4() {}
+ PointerUnion4() = default;
PointerUnion4(PT1 V) { Val = InnerUnion1(V); }
PointerUnion4(PT2 V) { Val = InnerUnion1(V); }
getAsVoidPointer(const PointerUnion4<PT1, PT2, PT3, PT4> &P) {
return P.getOpaqueValue();
}
+
static inline PointerUnion4<PT1, PT2, PT3, PT4> getFromVoidPointer(void *P) {
return PointerUnion4<PT1, PT2, PT3, PT4>::getFromOpaqueValue(P);
}
}
};
-}
+} // end namespace llvm
-#endif
+#endif // LLVM_ADT_POINTERUNION_H
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
+#include <cstddef>
namespace llvm {
class SmallString : public SmallVector<char, InternalLen> {
public:
/// Default ctor - Initialize to empty.
- SmallString() {}
+ SmallString() = default;
/// Initialize from a StringRef.
SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
SmallVectorImpl<char>::append(NumInputs, Elt);
}
-
/// Append from a StringRef.
void append(StringRef RHS) {
SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
}
};
-}
+} // end namespace llvm
-#endif
+#endif // LLVM_ADT_SMALLSTRING_H
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/PointerLikeTypeTraits.h"
+#include <cassert>
+#include <cstdint>
+#include <cstdlib>
#include <cstring>
#include <utility>
+#include <initializer_list>
+#include <new>
+#include <utility>
namespace llvm {
+
template<typename ValueT>
class StringMapConstIterator;
template<typename ValueT>
/// and data.
template<typename ValueTy>
class StringMapEntry : public StringMapEntryBase {
- StringMapEntry(StringMapEntry &E) = delete;
-
public:
ValueTy second;
template <typename... InitTy>
StringMapEntry(unsigned strLen, InitTy &&... InitVals)
: StringMapEntryBase(strLen), second(std::forward<InitTy>(InitVals)...) {}
+ StringMapEntry(StringMapEntry &E) = delete;
StringRef getKey() const {
return StringRef(getKeyData(), getKeyLength());
template <typename ValueTy> class StringMapConstIterator {
protected:
- StringMapEntryBase **Ptr;
+ StringMapEntryBase **Ptr = nullptr;
public:
typedef StringMapEntry<ValueTy> value_type;
- StringMapConstIterator() : Ptr(nullptr) { }
+ StringMapConstIterator() = default;
explicit StringMapConstIterator(StringMapEntryBase **Bucket,
bool NoAdvance = false)
template<typename ValueTy>
class StringMapIterator : public StringMapConstIterator<ValueTy> {
public:
- StringMapIterator() {}
+ StringMapIterator() = default;
+
explicit StringMapIterator(StringMapEntryBase **Bucket,
bool NoAdvance = false)
: StringMapConstIterator<ValueTy>(Bucket, NoAdvance) {
}
+
StringMapEntry<ValueTy> &operator*() const {
return *static_cast<StringMapEntry<ValueTy>*>(*this->Ptr);
}
return static_cast<StringMapEntry<ValueTy>*>(*this->Ptr);
}
};
-}
-#endif
+} // end namespace llvm
+
+#endif // LLVM_ADT_STRINGMAP_H
#include <cstddef>
#include <iterator>
+#include <type_traits>
namespace llvm {
mutable T Ptr;
public:
- pointer_iterator() {}
+ pointer_iterator() = default;
explicit pointer_iterator(WrappedIteratorT u)
: pointer_iterator::iterator_adaptor_base(std::move(u)) {}
const T &operator*() const { return Ptr = &*this->I; }
};
-} // namespace llvm
+} // end namespace llvm
-#endif
+#endif // LLVM_ADT_ITERATOR_H