mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 02:52:53 +02:00
Whitespace.
llvm-svn: 244431
This commit is contained in:
parent
b93b06ef3e
commit
c1197d9021
@ -1528,7 +1528,7 @@ public:
|
|||||||
/// \returns the nearest log base 2 of this APInt. Ties round up.
|
/// \returns the nearest log base 2 of this APInt. Ties round up.
|
||||||
///
|
///
|
||||||
/// NOTE: When we have a BitWidth of 1, we define:
|
/// NOTE: When we have a BitWidth of 1, we define:
|
||||||
///
|
///
|
||||||
/// log2(0) = UINT32_MAX
|
/// log2(0) = UINT32_MAX
|
||||||
/// log2(1) = 0
|
/// log2(1) = 0
|
||||||
///
|
///
|
||||||
|
@ -286,7 +286,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Determine if two APSInts have the same value, zero- or
|
/// \brief Determine if two APSInts have the same value, zero- or
|
||||||
/// sign-extending as needed.
|
/// sign-extending as needed.
|
||||||
static bool isSameValue(const APSInt &I1, const APSInt &I2) {
|
static bool isSameValue(const APSInt &I1, const APSInt &I2) {
|
||||||
return !compareValues(I1, I2);
|
return !compareValues(I1, I2);
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ private:
|
|||||||
/// \return - True on success.
|
/// \return - True on success.
|
||||||
bool Search(const changeset_ty &Changes, const changesetlist_ty &Sets,
|
bool Search(const changeset_ty &Changes, const changesetlist_ty &Sets,
|
||||||
changeset_ty &Res);
|
changeset_ty &Res);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// UpdatedSearchState - Callback used when the search state changes.
|
/// UpdatedSearchState - Callback used when the search state changes.
|
||||||
virtual void UpdatedSearchState(const changeset_ty &Changes,
|
virtual void UpdatedSearchState(const changeset_ty &Changes,
|
||||||
|
@ -58,7 +58,7 @@ template<> struct DenseMapInfo<char> {
|
|||||||
return LHS == RHS;
|
return LHS == RHS;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Provide DenseMapInfo for unsigned ints.
|
// Provide DenseMapInfo for unsigned ints.
|
||||||
template<> struct DenseMapInfo<unsigned> {
|
template<> struct DenseMapInfo<unsigned> {
|
||||||
static inline unsigned getEmptyKey() { return ~0U; }
|
static inline unsigned getEmptyKey() { return ~0U; }
|
||||||
|
@ -151,7 +151,7 @@ public:
|
|||||||
detail::DenseSetEmpty Empty;
|
detail::DenseSetEmpty Empty;
|
||||||
return TheMap.insert(std::make_pair(V, Empty));
|
return TheMap.insert(std::make_pair(V, Empty));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Range insertion of values.
|
// Range insertion of values.
|
||||||
template<typename InputIt>
|
template<typename InputIt>
|
||||||
void insert(InputIt I, InputIt E) {
|
void insert(InputIt I, InputIt E) {
|
||||||
|
@ -80,16 +80,16 @@ class df_iterator : public std::iterator<std::forward_iterator_tag,
|
|||||||
private:
|
private:
|
||||||
inline df_iterator(NodeType *Node) {
|
inline df_iterator(NodeType *Node) {
|
||||||
this->Visited.insert(Node);
|
this->Visited.insert(Node);
|
||||||
VisitStack.push_back(std::make_pair(PointerIntTy(Node, 0),
|
VisitStack.push_back(std::make_pair(PointerIntTy(Node, 0),
|
||||||
GT::child_begin(Node)));
|
GT::child_begin(Node)));
|
||||||
}
|
}
|
||||||
inline df_iterator() {
|
inline df_iterator() {
|
||||||
// End is when stack is empty
|
// End is when stack is empty
|
||||||
}
|
}
|
||||||
inline df_iterator(NodeType *Node, SetType &S)
|
inline df_iterator(NodeType *Node, SetType &S)
|
||||||
: df_iterator_storage<SetType, ExtStorage>(S) {
|
: df_iterator_storage<SetType, ExtStorage>(S) {
|
||||||
if (!S.count(Node)) {
|
if (!S.count(Node)) {
|
||||||
VisitStack.push_back(std::make_pair(PointerIntTy(Node, 0),
|
VisitStack.push_back(std::make_pair(PointerIntTy(Node, 0),
|
||||||
GT::child_begin(Node)));
|
GT::child_begin(Node)));
|
||||||
this->Visited.insert(Node);
|
this->Visited.insert(Node);
|
||||||
}
|
}
|
||||||
@ -115,7 +115,7 @@ private:
|
|||||||
// Has our next sibling been visited?
|
// Has our next sibling been visited?
|
||||||
if (Next && this->Visited.insert(Next).second) {
|
if (Next && this->Visited.insert(Next).second) {
|
||||||
// No, do it now.
|
// No, do it now.
|
||||||
VisitStack.push_back(std::make_pair(PointerIntTy(Next, 0),
|
VisitStack.push_back(std::make_pair(PointerIntTy(Next, 0),
|
||||||
GT::child_begin(Next)));
|
GT::child_begin(Next)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -717,8 +717,8 @@ 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);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ public:
|
|||||||
public:
|
public:
|
||||||
Factory(bool canonicalize = true)
|
Factory(bool canonicalize = true)
|
||||||
: Canonicalize(canonicalize) {}
|
: Canonicalize(canonicalize) {}
|
||||||
|
|
||||||
Factory(BumpPtrAllocator& Alloc, bool canonicalize = true)
|
Factory(BumpPtrAllocator& Alloc, bool canonicalize = true)
|
||||||
: F(Alloc), Canonicalize(canonicalize) {}
|
: F(Alloc), Canonicalize(canonicalize) {}
|
||||||
|
|
||||||
@ -145,11 +145,11 @@ public:
|
|||||||
TreeTy *getRootWithoutRetain() const {
|
TreeTy *getRootWithoutRetain() const {
|
||||||
return Root;
|
return Root;
|
||||||
}
|
}
|
||||||
|
|
||||||
void manualRetain() {
|
void manualRetain() {
|
||||||
if (Root) Root->retain();
|
if (Root) Root->retain();
|
||||||
}
|
}
|
||||||
|
|
||||||
void manualRelease() {
|
void manualRelease() {
|
||||||
if (Root) Root->release();
|
if (Root) Root->release();
|
||||||
}
|
}
|
||||||
@ -223,7 +223,7 @@ public:
|
|||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getMaxElement - Returns the <key,value> pair in the ImmutableMap for
|
/// getMaxElement - Returns the <key,value> pair in the ImmutableMap for
|
||||||
/// which key is the highest in the ordering of keys in the map. This
|
/// which key is the highest in the ordering of keys in the map. This
|
||||||
/// method returns NULL if the map is empty.
|
/// method returns NULL if the map is empty.
|
||||||
@ -259,17 +259,17 @@ public:
|
|||||||
typedef typename ValInfo::data_type_ref data_type_ref;
|
typedef typename ValInfo::data_type_ref data_type_ref;
|
||||||
typedef ImutAVLTree<ValInfo> TreeTy;
|
typedef ImutAVLTree<ValInfo> TreeTy;
|
||||||
typedef typename TreeTy::Factory FactoryTy;
|
typedef typename TreeTy::Factory FactoryTy;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
TreeTy *Root;
|
TreeTy *Root;
|
||||||
FactoryTy *Factory;
|
FactoryTy *Factory;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Constructs a map from a pointer to a tree root. In general one
|
/// Constructs a map from a pointer to a tree root. In general one
|
||||||
/// should use a Factory object to create maps instead of directly
|
/// should use a Factory object to create maps instead of directly
|
||||||
/// invoking the constructor, but there are cases where make this
|
/// invoking the constructor, but there are cases where make this
|
||||||
/// constructor public is useful.
|
/// constructor public is useful.
|
||||||
explicit ImmutableMapRef(const TreeTy* R, FactoryTy *F)
|
explicit ImmutableMapRef(const TreeTy* R, FactoryTy *F)
|
||||||
: Root(const_cast<TreeTy*>(R)),
|
: Root(const_cast<TreeTy*>(R)),
|
||||||
Factory(F) {
|
Factory(F) {
|
||||||
if (Root) { Root->retain(); }
|
if (Root) { Root->retain(); }
|
||||||
@ -281,7 +281,7 @@ public:
|
|||||||
Factory(F.getTreeFactory()) {
|
Factory(F.getTreeFactory()) {
|
||||||
if (Root) { Root->retain(); }
|
if (Root) { Root->retain(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
ImmutableMapRef(const ImmutableMapRef &X)
|
ImmutableMapRef(const ImmutableMapRef &X)
|
||||||
: Root(X.Root),
|
: Root(X.Root),
|
||||||
Factory(X.Factory) {
|
Factory(X.Factory) {
|
||||||
@ -292,10 +292,10 @@ public:
|
|||||||
if (Root != X.Root) {
|
if (Root != X.Root) {
|
||||||
if (X.Root)
|
if (X.Root)
|
||||||
X.Root->retain();
|
X.Root->retain();
|
||||||
|
|
||||||
if (Root)
|
if (Root)
|
||||||
Root->release();
|
Root->release();
|
||||||
|
|
||||||
Root = X.Root;
|
Root = X.Root;
|
||||||
Factory = X.Factory;
|
Factory = X.Factory;
|
||||||
}
|
}
|
||||||
@ -306,7 +306,7 @@ public:
|
|||||||
if (Root)
|
if (Root)
|
||||||
Root->release();
|
Root->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline ImmutableMapRef getEmptyMap(FactoryTy *F) {
|
static inline ImmutableMapRef getEmptyMap(FactoryTy *F) {
|
||||||
return ImmutableMapRef(0, F);
|
return ImmutableMapRef(0, F);
|
||||||
}
|
}
|
||||||
@ -328,31 +328,31 @@ public:
|
|||||||
TreeTy *NewT = Factory->remove(Root, K);
|
TreeTy *NewT = Factory->remove(Root, K);
|
||||||
return ImmutableMapRef(NewT, Factory);
|
return ImmutableMapRef(NewT, Factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool contains(key_type_ref K) const {
|
bool contains(key_type_ref K) const {
|
||||||
return Root ? Root->contains(K) : false;
|
return Root ? Root->contains(K) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImmutableMap<KeyT, ValT> asImmutableMap() const {
|
ImmutableMap<KeyT, ValT> asImmutableMap() const {
|
||||||
return ImmutableMap<KeyT, ValT>(Factory->getCanonicalTree(Root));
|
return ImmutableMap<KeyT, ValT>(Factory->getCanonicalTree(Root));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const ImmutableMapRef &RHS) const {
|
bool operator==(const ImmutableMapRef &RHS) const {
|
||||||
return Root && RHS.Root ? Root->isEqual(*RHS.Root) : Root == RHS.Root;
|
return Root && RHS.Root ? Root->isEqual(*RHS.Root) : Root == RHS.Root;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator!=(const ImmutableMapRef &RHS) const {
|
bool operator!=(const ImmutableMapRef &RHS) const {
|
||||||
return Root && RHS.Root ? Root->isNotEqual(*RHS.Root) : Root != RHS.Root;
|
return Root && RHS.Root ? Root->isNotEqual(*RHS.Root) : Root != RHS.Root;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isEmpty() const { return !Root; }
|
bool isEmpty() const { return !Root; }
|
||||||
|
|
||||||
//===--------------------------------------------------===//
|
//===--------------------------------------------------===//
|
||||||
// For testing.
|
// For testing.
|
||||||
//===--------------------------------------------------===//
|
//===--------------------------------------------------===//
|
||||||
|
|
||||||
void verify() const { if (Root) Root->verify(); }
|
void verify() const { if (Root) Root->verify(); }
|
||||||
|
|
||||||
//===--------------------------------------------------===//
|
//===--------------------------------------------------===//
|
||||||
// Iterators.
|
// Iterators.
|
||||||
//===--------------------------------------------------===//
|
//===--------------------------------------------------===//
|
||||||
@ -369,38 +369,38 @@ public:
|
|||||||
|
|
||||||
iterator begin() const { return iterator(Root); }
|
iterator begin() const { return iterator(Root); }
|
||||||
iterator end() const { return iterator(); }
|
iterator end() const { return iterator(); }
|
||||||
|
|
||||||
data_type* lookup(key_type_ref K) const {
|
data_type* lookup(key_type_ref K) const {
|
||||||
if (Root) {
|
if (Root) {
|
||||||
TreeTy* T = Root->find(K);
|
TreeTy* T = Root->find(K);
|
||||||
if (T) return &T->getValue().second;
|
if (T) return &T->getValue().second;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getMaxElement - Returns the <key,value> pair in the ImmutableMap for
|
/// getMaxElement - Returns the <key,value> pair in the ImmutableMap for
|
||||||
/// which key is the highest in the ordering of keys in the map. This
|
/// which key is the highest in the ordering of keys in the map. This
|
||||||
/// method returns NULL if the map is empty.
|
/// method returns NULL if the map is empty.
|
||||||
value_type* getMaxElement() const {
|
value_type* getMaxElement() const {
|
||||||
return Root ? &(Root->getMaxElement()->getValue()) : 0;
|
return Root ? &(Root->getMaxElement()->getValue()) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//===--------------------------------------------------===//
|
//===--------------------------------------------------===//
|
||||||
// Utility methods.
|
// Utility methods.
|
||||||
//===--------------------------------------------------===//
|
//===--------------------------------------------------===//
|
||||||
|
|
||||||
unsigned getHeight() const { return Root ? Root->getHeight() : 0; }
|
unsigned getHeight() const { return Root ? Root->getHeight() : 0; }
|
||||||
|
|
||||||
static inline void Profile(FoldingSetNodeID& ID, const ImmutableMapRef &M) {
|
static inline void Profile(FoldingSetNodeID& ID, const ImmutableMapRef &M) {
|
||||||
ID.AddPointer(M.Root);
|
ID.AddPointer(M.Root);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void Profile(FoldingSetNodeID& ID) const {
|
inline void Profile(FoldingSetNodeID& ID) const {
|
||||||
return Profile(ID, *this);
|
return Profile(ID, *this);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -83,9 +83,9 @@ public:
|
|||||||
PackedVector &Vec;
|
PackedVector &Vec;
|
||||||
const unsigned Idx;
|
const unsigned Idx;
|
||||||
|
|
||||||
reference(); // Undefined
|
reference(); // Undefined
|
||||||
public:
|
public:
|
||||||
reference(PackedVector &vec, unsigned idx) : Vec(vec), Idx(idx) { }
|
reference(PackedVector &vec, unsigned idx) : Vec(vec), Idx(idx) { }
|
||||||
|
|
||||||
reference &operator=(T val) {
|
reference &operator=(T val) {
|
||||||
Vec.setValue(Vec.Bits, Idx, val);
|
Vec.setValue(Vec.Bits, Idx, val);
|
||||||
@ -102,9 +102,9 @@ public:
|
|||||||
bool empty() const { return Bits.empty(); }
|
bool empty() const { return Bits.empty(); }
|
||||||
|
|
||||||
unsigned size() const { return Bits.size() >> (BitNum-1); }
|
unsigned size() const { return Bits.size() >> (BitNum-1); }
|
||||||
|
|
||||||
void clear() { Bits.clear(); }
|
void clear() { Bits.clear(); }
|
||||||
|
|
||||||
void resize(unsigned N) { Bits.resize(N << (BitNum-1)); }
|
void resize(unsigned N) { Bits.resize(N << (BitNum-1)); }
|
||||||
|
|
||||||
void reserve(unsigned N) { Bits.reserve(N << (BitNum-1)); }
|
void reserve(unsigned N) { Bits.reserve(N << (BitNum-1)); }
|
||||||
@ -150,7 +150,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Leave BitNum=0 undefined.
|
// Leave BitNum=0 undefined.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class PackedVector<T, 0>;
|
class PackedVector<T, 0>;
|
||||||
|
|
||||||
|
@ -55,10 +55,10 @@ class PointerIntPair {
|
|||||||
/// IntShift - The number of low bits that we reserve for other uses, and
|
/// IntShift - The number of low bits that we reserve for other uses, and
|
||||||
/// keep zero.
|
/// keep zero.
|
||||||
IntShift = (uintptr_t)PtrTraits::NumLowBitsAvailable-IntBits,
|
IntShift = (uintptr_t)PtrTraits::NumLowBitsAvailable-IntBits,
|
||||||
|
|
||||||
/// IntMask - This is the unshifted mask for valid bits of the int type.
|
/// IntMask - This is the unshifted mask for valid bits of the int type.
|
||||||
IntMask = (uintptr_t)(((intptr_t)1 << IntBits)-1),
|
IntMask = (uintptr_t)(((intptr_t)1 << IntBits)-1),
|
||||||
|
|
||||||
// ShiftedIntMask - This is the bits for the integer shifted in place.
|
// ShiftedIntMask - This is the bits for the integer shifted in place.
|
||||||
ShiftedIntMask = (uintptr_t)(IntMask << IntShift)
|
ShiftedIntMask = (uintptr_t)(IntMask << IntShift)
|
||||||
};
|
};
|
||||||
@ -93,7 +93,7 @@ public:
|
|||||||
void setInt(IntType IntVal) {
|
void setInt(IntType IntVal) {
|
||||||
intptr_t IntWord = static_cast<intptr_t>(IntVal);
|
intptr_t IntWord = static_cast<intptr_t>(IntVal);
|
||||||
assert((IntWord & ~IntMask) == 0 && "Integer too large for field");
|
assert((IntWord & ~IntMask) == 0 && "Integer too large for field");
|
||||||
|
|
||||||
// Preserve all bits other than the ones we are updating.
|
// Preserve all bits other than the ones we are updating.
|
||||||
Value &= ~ShiftedIntMask; // Remove integer field.
|
Value &= ~ShiftedIntMask; // Remove integer field.
|
||||||
Value |= IntWord << IntShift; // Set new integer.
|
Value |= IntWord << IntShift; // Set new integer.
|
||||||
@ -133,7 +133,7 @@ public:
|
|||||||
void setFromOpaqueValue(void *Val) { Value = reinterpret_cast<intptr_t>(Val);}
|
void setFromOpaqueValue(void *Val) { Value = reinterpret_cast<intptr_t>(Val);}
|
||||||
|
|
||||||
static PointerIntPair getFromOpaqueValue(void *V) {
|
static PointerIntPair getFromOpaqueValue(void *V) {
|
||||||
PointerIntPair P; P.setFromOpaqueValue(V); return P;
|
PointerIntPair P; P.setFromOpaqueValue(V); return P;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allow PointerIntPairs to be created from const void * if and only if the
|
// Allow PointerIntPairs to be created from const void * if and only if the
|
||||||
@ -156,7 +156,7 @@ template<typename PointerTy, unsigned IntBits, typename IntType>
|
|||||||
struct isPodLike<PointerIntPair<PointerTy, IntBits, IntType> > {
|
struct isPodLike<PointerIntPair<PointerTy, IntBits, IntType> > {
|
||||||
static const bool value = true;
|
static const bool value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Provide specialization of DenseMapInfo for PointerIntPair.
|
// Provide specialization of DenseMapInfo for PointerIntPair.
|
||||||
template<typename PointerTy, unsigned IntBits, typename IntType>
|
template<typename PointerTy, unsigned IntBits, typename IntType>
|
||||||
struct DenseMapInfo<PointerIntPair<PointerTy, IntBits, IntType> > {
|
struct DenseMapInfo<PointerIntPair<PointerTy, IntBits, IntType> > {
|
||||||
|
@ -56,7 +56,7 @@ public:
|
|||||||
ScopedHashTableVal *getNextForKey() { return NextForKey; }
|
ScopedHashTableVal *getNextForKey() { return NextForKey; }
|
||||||
const ScopedHashTableVal *getNextForKey() const { return NextForKey; }
|
const ScopedHashTableVal *getNextForKey() const { return NextForKey; }
|
||||||
ScopedHashTableVal *getNextInScope() { return NextInScope; }
|
ScopedHashTableVal *getNextInScope() { return NextInScope; }
|
||||||
|
|
||||||
template <typename AllocatorTy>
|
template <typename AllocatorTy>
|
||||||
static ScopedHashTableVal *Create(ScopedHashTableVal *nextInScope,
|
static ScopedHashTableVal *Create(ScopedHashTableVal *nextInScope,
|
||||||
ScopedHashTableVal *nextForKey,
|
ScopedHashTableVal *nextForKey,
|
||||||
@ -66,10 +66,10 @@ public:
|
|||||||
// Set up the value.
|
// Set up the value.
|
||||||
new (New) ScopedHashTableVal(key, val);
|
new (New) ScopedHashTableVal(key, val);
|
||||||
New->NextInScope = nextInScope;
|
New->NextInScope = nextInScope;
|
||||||
New->NextForKey = nextForKey;
|
New->NextForKey = nextForKey;
|
||||||
return New;
|
return New;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename AllocatorTy>
|
template <typename AllocatorTy>
|
||||||
void Destroy(AllocatorTy &Allocator) {
|
void Destroy(AllocatorTy &Allocator) {
|
||||||
// Free memory referenced by the item.
|
// Free memory referenced by the item.
|
||||||
@ -99,7 +99,7 @@ public:
|
|||||||
|
|
||||||
ScopedHashTableScope *getParentScope() { return PrevScope; }
|
ScopedHashTableScope *getParentScope() { return PrevScope; }
|
||||||
const ScopedHashTableScope *getParentScope() const { return PrevScope; }
|
const ScopedHashTableScope *getParentScope() const { return PrevScope; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class ScopedHashTable<K, V, KInfo, AllocatorTy>;
|
friend class ScopedHashTable<K, V, KInfo, AllocatorTy>;
|
||||||
ScopedHashTableVal<K, V> *getLastValInScope() {
|
ScopedHashTableVal<K, V> *getLastValInScope() {
|
||||||
@ -154,9 +154,9 @@ private:
|
|||||||
typedef ScopedHashTableVal<K, V> ValTy;
|
typedef ScopedHashTableVal<K, V> ValTy;
|
||||||
DenseMap<K, ValTy*, KInfo> TopLevelMap;
|
DenseMap<K, ValTy*, KInfo> TopLevelMap;
|
||||||
ScopeTy *CurScope;
|
ScopeTy *CurScope;
|
||||||
|
|
||||||
AllocatorTy Allocator;
|
AllocatorTy Allocator;
|
||||||
|
|
||||||
ScopedHashTable(const ScopedHashTable&); // NOT YET IMPLEMENTED
|
ScopedHashTable(const ScopedHashTable&); // NOT YET IMPLEMENTED
|
||||||
void operator=(const ScopedHashTable&); // NOT YET IMPLEMENTED
|
void operator=(const ScopedHashTable&); // NOT YET IMPLEMENTED
|
||||||
friend class ScopedHashTableScope<K, V, KInfo, AllocatorTy>;
|
friend class ScopedHashTableScope<K, V, KInfo, AllocatorTy>;
|
||||||
@ -181,7 +181,7 @@ public:
|
|||||||
typename DenseMap<K, ValTy*, KInfo>::iterator I = TopLevelMap.find(Key);
|
typename DenseMap<K, ValTy*, KInfo>::iterator I = TopLevelMap.find(Key);
|
||||||
if (I != TopLevelMap.end())
|
if (I != TopLevelMap.end())
|
||||||
return I->second->getValue();
|
return I->second->getValue();
|
||||||
|
|
||||||
return V();
|
return V();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ public:
|
|||||||
if (I == TopLevelMap.end()) return end();
|
if (I == TopLevelMap.end()) return end();
|
||||||
return iterator(I->second);
|
return iterator(I->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScopeTy *getCurScope() { return CurScope; }
|
ScopeTy *getCurScope() { return CurScope; }
|
||||||
const ScopeTy *getCurScope() const { return CurScope; }
|
const ScopeTy *getCurScope() const { return CurScope; }
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ public:
|
|||||||
set_.erase(back());
|
set_.erase(back());
|
||||||
vector_.pop_back();
|
vector_.pop_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val() {
|
T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val() {
|
||||||
T Ret = back();
|
T Ret = back();
|
||||||
pop_back();
|
pop_back();
|
||||||
|
@ -181,14 +181,14 @@ protected:
|
|||||||
template<typename PtrTy>
|
template<typename PtrTy>
|
||||||
class SmallPtrSetIterator : public SmallPtrSetIteratorImpl {
|
class SmallPtrSetIterator : public SmallPtrSetIteratorImpl {
|
||||||
typedef PointerLikeTypeTraits<PtrTy> PtrTraits;
|
typedef PointerLikeTypeTraits<PtrTy> PtrTraits;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef PtrTy value_type;
|
typedef PtrTy value_type;
|
||||||
typedef PtrTy reference;
|
typedef PtrTy reference;
|
||||||
typedef PtrTy pointer;
|
typedef PtrTy pointer;
|
||||||
typedef std::ptrdiff_t difference_type;
|
typedef std::ptrdiff_t difference_type;
|
||||||
typedef std::forward_iterator_tag iterator_category;
|
typedef std::forward_iterator_tag iterator_category;
|
||||||
|
|
||||||
explicit SmallPtrSetIterator(const void *const *BP, const void *const *E)
|
explicit SmallPtrSetIterator(const void *const *BP, const void *const *E)
|
||||||
: SmallPtrSetIteratorImpl(BP, E) {}
|
: SmallPtrSetIteratorImpl(BP, E) {}
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ public:
|
|||||||
for (; I != E; ++I)
|
for (; I != E; ++I)
|
||||||
insert(*I);
|
insert(*I);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool erase(const T &V) {
|
bool erase(const T &V) {
|
||||||
if (!isSmall())
|
if (!isSmall())
|
||||||
return Set.erase(V);
|
return Set.erase(V);
|
||||||
|
@ -220,7 +220,7 @@ class StringMap : public StringMapImpl {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
typedef StringMapEntry<ValueTy> MapEntryTy;
|
typedef StringMapEntry<ValueTy> MapEntryTy;
|
||||||
|
|
||||||
StringMap() : StringMapImpl(static_cast<unsigned>(sizeof(MapEntryTy))) {}
|
StringMap() : StringMapImpl(static_cast<unsigned>(sizeof(MapEntryTy))) {}
|
||||||
explicit StringMap(unsigned InitialSize)
|
explicit StringMap(unsigned InitialSize)
|
||||||
: StringMapImpl(InitialSize, static_cast<unsigned>(sizeof(MapEntryTy))) {}
|
: StringMapImpl(InitialSize, static_cast<unsigned>(sizeof(MapEntryTy))) {}
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include "llvm/ADT/SmallVector.h"
|
#include "llvm/ADT/SmallVector.h"
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
/// TinyPtrVector - This class is specialized for cases where there are
|
/// TinyPtrVector - This class is specialized for cases where there are
|
||||||
/// normally 0 or 1 element in a vector, but is general enough to go beyond that
|
/// normally 0 or 1 element in a vector, but is general enough to go beyond that
|
||||||
/// when required.
|
/// when required.
|
||||||
|
@ -111,7 +111,7 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
bool cleanupFired;
|
bool cleanupFired;
|
||||||
|
|
||||||
virtual ~CrashRecoveryContextCleanup();
|
virtual ~CrashRecoveryContextCleanup();
|
||||||
virtual void recoverResources() = 0;
|
virtual void recoverResources() = 0;
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ class CrashRecoveryContextDestructorCleanup : public
|
|||||||
CrashRecoveryContextCleanupBase<CrashRecoveryContextDestructorCleanup<T>, T> {
|
CrashRecoveryContextCleanupBase<CrashRecoveryContextDestructorCleanup<T>, T> {
|
||||||
public:
|
public:
|
||||||
CrashRecoveryContextDestructorCleanup(CrashRecoveryContext *context,
|
CrashRecoveryContextDestructorCleanup(CrashRecoveryContext *context,
|
||||||
T *resource)
|
T *resource)
|
||||||
: CrashRecoveryContextCleanupBase<
|
: CrashRecoveryContextCleanupBase<
|
||||||
CrashRecoveryContextDestructorCleanup<T>, T>(context, resource) {}
|
CrashRecoveryContextDestructorCleanup<T>, T>(context, resource) {}
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ class CrashRecoveryContextReleaseRefCleanup : public
|
|||||||
CrashRecoveryContextCleanupBase<CrashRecoveryContextReleaseRefCleanup<T>, T>
|
CrashRecoveryContextCleanupBase<CrashRecoveryContextReleaseRefCleanup<T>, T>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CrashRecoveryContextReleaseRefCleanup(CrashRecoveryContext *context,
|
CrashRecoveryContextReleaseRefCleanup(CrashRecoveryContext *context,
|
||||||
T *resource)
|
T *resource)
|
||||||
: CrashRecoveryContextCleanupBase<CrashRecoveryContextReleaseRefCleanup<T>,
|
: CrashRecoveryContextCleanupBase<CrashRecoveryContextReleaseRefCleanup<T>,
|
||||||
T>(context, resource) {}
|
T>(context, resource) {}
|
||||||
@ -193,7 +193,7 @@ public:
|
|||||||
~CrashRecoveryContextCleanupRegistrar() {
|
~CrashRecoveryContextCleanupRegistrar() {
|
||||||
unregister();
|
unregister();
|
||||||
}
|
}
|
||||||
|
|
||||||
void unregister() {
|
void unregister() {
|
||||||
if (cleanup && !cleanup->cleanupFired)
|
if (cleanup && !cleanup->cleanupFired)
|
||||||
cleanup->getContext()->unregisterCleanup(cleanup);
|
cleanup->getContext()->unregisterCleanup(cleanup);
|
||||||
|
@ -610,7 +610,7 @@ unsigned getAttributeEncoding(StringRef EncodingString);
|
|||||||
const char *AttributeValueString(uint16_t Attr, unsigned Val);
|
const char *AttributeValueString(uint16_t Attr, unsigned Val);
|
||||||
|
|
||||||
/// \brief Decsribes an entry of the various gnu_pub* debug sections.
|
/// \brief Decsribes an entry of the various gnu_pub* debug sections.
|
||||||
///
|
///
|
||||||
/// The gnu_pub* kind looks like:
|
/// The gnu_pub* kind looks like:
|
||||||
///
|
///
|
||||||
/// 0-3 reserved
|
/// 0-3 reserved
|
||||||
|
@ -67,7 +67,7 @@ namespace llvm {
|
|||||||
///
|
///
|
||||||
/// If no error handler is installed the default is to print the message to
|
/// If no error handler is installed the default is to print the message to
|
||||||
/// standard error, followed by a newline.
|
/// standard error, followed by a newline.
|
||||||
/// After the error handler is called this function will call exit(1), it
|
/// After the error handler is called this function will call exit(1), it
|
||||||
/// does not return.
|
/// does not return.
|
||||||
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const char *reason,
|
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const char *reason,
|
||||||
bool gen_crash_diag = true);
|
bool gen_crash_diag = true);
|
||||||
|
@ -97,19 +97,19 @@ enum perms {
|
|||||||
// Helper functions so that you can use & and | to manipulate perms bits:
|
// Helper functions so that you can use & and | to manipulate perms bits:
|
||||||
inline perms operator|(perms l , perms r) {
|
inline perms operator|(perms l , perms r) {
|
||||||
return static_cast<perms>(
|
return static_cast<perms>(
|
||||||
static_cast<unsigned short>(l) | static_cast<unsigned short>(r));
|
static_cast<unsigned short>(l) | static_cast<unsigned short>(r));
|
||||||
}
|
}
|
||||||
inline perms operator&(perms l , perms r) {
|
inline perms operator&(perms l , perms r) {
|
||||||
return static_cast<perms>(
|
return static_cast<perms>(
|
||||||
static_cast<unsigned short>(l) & static_cast<unsigned short>(r));
|
static_cast<unsigned short>(l) & static_cast<unsigned short>(r));
|
||||||
}
|
}
|
||||||
inline perms &operator|=(perms &l, perms r) {
|
inline perms &operator|=(perms &l, perms r) {
|
||||||
l = l | r;
|
l = l | r;
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
inline perms &operator&=(perms &l, perms r) {
|
inline perms &operator&=(perms &l, perms r) {
|
||||||
l = l & r;
|
l = l & r;
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
inline perms operator~(perms x) {
|
inline perms operator~(perms x) {
|
||||||
return static_cast<perms>(~static_cast<unsigned short>(x));
|
return static_cast<perms>(~static_cast<unsigned short>(x));
|
||||||
|
@ -180,7 +180,7 @@ inline FormattedNumber format_hex_no_prefix(uint64_t N, unsigned Width,
|
|||||||
return FormattedNumber(N, 0, Width, true, Upper, false);
|
return FormattedNumber(N, 0, Width, true, Upper, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// format_decimal - Output \p N as a right justified, fixed-width decimal. If
|
/// format_decimal - Output \p N as a right justified, fixed-width decimal. If
|
||||||
/// number will not fit in width, full number is still printed. Examples:
|
/// number will not fit in width, full number is still printed. Examples:
|
||||||
/// OS << format_decimal(0, 5) => " 0"
|
/// OS << format_decimal(0, 5) => " 0"
|
||||||
/// OS << format_decimal(255, 5) => " 255"
|
/// OS << format_decimal(255, 5) => " 255"
|
||||||
|
@ -87,7 +87,7 @@ unsigned DFSPass(DominatorTreeBase<typename GraphT::NodeType>& DT,
|
|||||||
|
|
||||||
// Increment the successor number for the next time we get to it.
|
// Increment the successor number for the next time we get to it.
|
||||||
++Worklist.back().second;
|
++Worklist.back().second;
|
||||||
|
|
||||||
// Visit the successor next, if it isn't already visited.
|
// Visit the successor next, if it isn't already visited.
|
||||||
typename GraphT::NodeType* Succ = *NextSucc;
|
typename GraphT::NodeType* Succ = *NextSucc;
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ unsigned DFSPass(DominatorTreeBase<typename GraphT::NodeType>& DT,
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<class GraphT>
|
template<class GraphT>
|
||||||
typename GraphT::NodeType*
|
typename GraphT::NodeType*
|
||||||
Eval(DominatorTreeBase<typename GraphT::NodeType>& DT,
|
Eval(DominatorTreeBase<typename GraphT::NodeType>& DT,
|
||||||
typename GraphT::NodeType *VIn, unsigned LastLinked) {
|
typename GraphT::NodeType *VIn, unsigned LastLinked) {
|
||||||
typename DominatorTreeBase<typename GraphT::NodeType>::InfoRec &VInInfo =
|
typename DominatorTreeBase<typename GraphT::NodeType>::InfoRec &VInInfo =
|
||||||
@ -116,7 +116,7 @@ Eval(DominatorTreeBase<typename GraphT::NodeType>& DT,
|
|||||||
|
|
||||||
if (VInInfo.Parent >= LastLinked)
|
if (VInInfo.Parent >= LastLinked)
|
||||||
Work.push_back(VIn);
|
Work.push_back(VIn);
|
||||||
|
|
||||||
while (!Work.empty()) {
|
while (!Work.empty()) {
|
||||||
typename GraphT::NodeType* V = Work.back();
|
typename GraphT::NodeType* V = Work.back();
|
||||||
typename DominatorTreeBase<typename GraphT::NodeType>::InfoRec &VInfo =
|
typename DominatorTreeBase<typename GraphT::NodeType>::InfoRec &VInfo =
|
||||||
@ -127,8 +127,8 @@ Eval(DominatorTreeBase<typename GraphT::NodeType>& DT,
|
|||||||
if (Visited.insert(VAncestor).second && VInfo.Parent >= LastLinked) {
|
if (Visited.insert(VAncestor).second && VInfo.Parent >= LastLinked) {
|
||||||
Work.push_back(VAncestor);
|
Work.push_back(VAncestor);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Work.pop_back();
|
Work.pop_back();
|
||||||
|
|
||||||
// Update VInfo based on Ancestor info
|
// Update VInfo based on Ancestor info
|
||||||
if (VInfo.Parent < LastLinked)
|
if (VInfo.Parent < LastLinked)
|
||||||
@ -168,7 +168,7 @@ void Calculate(DominatorTreeBase<typename GraphTraits<NodeT>::NodeType>& DT,
|
|||||||
i != e; ++i)
|
i != e; ++i)
|
||||||
N = DFSPass<GraphT>(DT, DT.Roots[i], N);
|
N = DFSPass<GraphT>(DT, DT.Roots[i], N);
|
||||||
|
|
||||||
// it might be that some blocks did not get a DFS number (e.g., blocks of
|
// it might be that some blocks did not get a DFS number (e.g., blocks of
|
||||||
// infinite loops). In these cases an artificial exit node is required.
|
// infinite loops). In these cases an artificial exit node is required.
|
||||||
MultipleRoots |= (DT.isPostDominator() && N != GraphTraits<FuncT*>::size(&F));
|
MultipleRoots |= (DT.isPostDominator() && N != GraphTraits<FuncT*>::size(&F));
|
||||||
|
|
||||||
|
@ -383,7 +383,7 @@ namespace llvm {
|
|||||||
SELF_LIBRARY_ORDINAL = 0x0,
|
SELF_LIBRARY_ORDINAL = 0x0,
|
||||||
MAX_LIBRARY_ORDINAL = 0xfd,
|
MAX_LIBRARY_ORDINAL = 0xfd,
|
||||||
DYNAMIC_LOOKUP_ORDINAL = 0xfe,
|
DYNAMIC_LOOKUP_ORDINAL = 0xfe,
|
||||||
EXECUTABLE_ORDINAL = 0xff
|
EXECUTABLE_ORDINAL = 0xff
|
||||||
};
|
};
|
||||||
|
|
||||||
enum StabType {
|
enum StabType {
|
||||||
|
@ -552,7 +552,7 @@ inline uint32_t FloatToBits(float Float) {
|
|||||||
inline uint64_t MinAlign(uint64_t A, uint64_t B) {
|
inline uint64_t MinAlign(uint64_t A, uint64_t B) {
|
||||||
// The largest power of 2 that divides both A and B.
|
// The largest power of 2 that divides both A and B.
|
||||||
//
|
//
|
||||||
// Replace "-Value" by "1+~Value" in the following commented code to avoid
|
// Replace "-Value" by "1+~Value" in the following commented code to avoid
|
||||||
// MSVC warning C4146
|
// MSVC warning C4146
|
||||||
// return (A | B) & -(A | B);
|
// return (A | B) & -(A | B);
|
||||||
return (A | B) & (1 + ~(A | B));
|
return (A | B) & (1 + ~(A | B));
|
||||||
|
@ -71,7 +71,7 @@ namespace sys {
|
|||||||
/// If the address following \p NearBlock is not so aligned, it will be
|
/// If the address following \p NearBlock is not so aligned, it will be
|
||||||
/// rounded up to the next allocation granularity boundary.
|
/// rounded up to the next allocation granularity boundary.
|
||||||
///
|
///
|
||||||
/// \r a non-null MemoryBlock if the function was successful,
|
/// \r a non-null MemoryBlock if the function was successful,
|
||||||
/// otherwise a null MemoryBlock is with \p EC describing the error.
|
/// otherwise a null MemoryBlock is with \p EC describing the error.
|
||||||
///
|
///
|
||||||
/// @brief Allocate mapped memory.
|
/// @brief Allocate mapped memory.
|
||||||
@ -87,7 +87,7 @@ namespace sys {
|
|||||||
///
|
///
|
||||||
/// \r error_success if the function was successful, or an error_code
|
/// \r error_success if the function was successful, or an error_code
|
||||||
/// describing the failure if an error occurred.
|
/// describing the failure if an error occurred.
|
||||||
///
|
///
|
||||||
/// @brief Release mapped memory.
|
/// @brief Release mapped memory.
|
||||||
static std::error_code releaseMappedMemory(MemoryBlock &Block);
|
static std::error_code releaseMappedMemory(MemoryBlock &Block);
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ StringRef root_name(StringRef path);
|
|||||||
/// @result The root directory of \a path if it has one, otherwise
|
/// @result The root directory of \a path if it has one, otherwise
|
||||||
/// "".
|
/// "".
|
||||||
StringRef root_directory(StringRef path);
|
StringRef root_directory(StringRef path);
|
||||||
|
|
||||||
/// @brief Get root path.
|
/// @brief Get root path.
|
||||||
///
|
///
|
||||||
/// Equivalent to root_name + root_directory.
|
/// Equivalent to root_name + root_directory.
|
||||||
@ -308,7 +308,7 @@ bool is_separator(char value);
|
|||||||
/// @result StringRef of the preferred separator, null-terminated.
|
/// @result StringRef of the preferred separator, null-terminated.
|
||||||
StringRef get_separator();
|
StringRef get_separator();
|
||||||
|
|
||||||
/// @brief Get the typical temporary directory for the system, e.g.,
|
/// @brief Get the typical temporary directory for the system, e.g.,
|
||||||
/// "/var/tmp" or "C:/TEMP"
|
/// "/var/tmp" or "C:/TEMP"
|
||||||
///
|
///
|
||||||
/// @param erasedOnReboot Whether to favor a path that is erased on reboot
|
/// @param erasedOnReboot Whether to favor a path that is erased on reboot
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include "llvm/Support/DataTypes.h"
|
#include "llvm/Support/DataTypes.h"
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
/// PointerLikeTypeTraits - This is a traits object that is used to handle
|
/// PointerLikeTypeTraits - This is a traits object that is used to handle
|
||||||
/// pointer types and things that are just wrappers for pointers as a uniform
|
/// pointer types and things that are just wrappers for pointers as a uniform
|
||||||
/// entity.
|
/// entity.
|
||||||
@ -37,7 +37,7 @@ public:
|
|||||||
static inline T *getFromVoidPointer(void *P) {
|
static inline T *getFromVoidPointer(void *P) {
|
||||||
return static_cast<T*>(P);
|
return static_cast<T*>(P);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Note, we assume here that malloc returns objects at least 4-byte aligned.
|
/// Note, we assume here that malloc returns objects at least 4-byte aligned.
|
||||||
/// However, this may be wrong, or pointers may be from something other than
|
/// However, this may be wrong, or pointers may be from something other than
|
||||||
/// malloc. In this case, you should specialize this template to reduce this.
|
/// malloc. In this case, you should specialize this template to reduce this.
|
||||||
@ -46,7 +46,7 @@ public:
|
|||||||
/// this is actually true.
|
/// this is actually true.
|
||||||
enum { NumLowBitsAvailable = 2 };
|
enum { NumLowBitsAvailable = 2 };
|
||||||
};
|
};
|
||||||
|
|
||||||
// Provide PointerLikeTypeTraits for const pointers.
|
// Provide PointerLikeTypeTraits for const pointers.
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class PointerLikeTypeTraits<const T*> {
|
class PointerLikeTypeTraits<const T*> {
|
||||||
@ -75,7 +75,7 @@ public:
|
|||||||
// No bits are available!
|
// No bits are available!
|
||||||
enum { NumLowBitsAvailable = 0 };
|
enum { NumLowBitsAvailable = 0 };
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -54,10 +54,10 @@ public:
|
|||||||
assert(Start.isValid() == End.isValid() &&
|
assert(Start.isValid() == End.isValid() &&
|
||||||
"Start and end should either both be valid or both be invalid!");
|
"Start and end should either both be valid or both be invalid!");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isValid() const { return Start.isValid(); }
|
bool isValid() const { return Start.isValid(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -25,11 +25,11 @@ extern "C" {
|
|||||||
|
|
||||||
#define LLVM_TARGET(TargetName) void LLVMInitialize##TargetName##Target();
|
#define LLVM_TARGET(TargetName) void LLVMInitialize##TargetName##Target();
|
||||||
#include "llvm/Config/Targets.def"
|
#include "llvm/Config/Targets.def"
|
||||||
|
|
||||||
// Declare all of the target-MC-initialization functions that are available.
|
// Declare all of the target-MC-initialization functions that are available.
|
||||||
#define LLVM_TARGET(TargetName) void LLVMInitialize##TargetName##TargetMC();
|
#define LLVM_TARGET(TargetName) void LLVMInitialize##TargetName##TargetMC();
|
||||||
#include "llvm/Config/Targets.def"
|
#include "llvm/Config/Targets.def"
|
||||||
|
|
||||||
// Declare all of the available assembly printer initialization functions.
|
// Declare all of the available assembly printer initialization functions.
|
||||||
#define LLVM_ASM_PRINTER(TargetName) void LLVMInitialize##TargetName##AsmPrinter();
|
#define LLVM_ASM_PRINTER(TargetName) void LLVMInitialize##TargetName##AsmPrinter();
|
||||||
#include "llvm/Config/AsmPrinters.def"
|
#include "llvm/Config/AsmPrinters.def"
|
||||||
@ -54,7 +54,7 @@ namespace llvm {
|
|||||||
#define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##TargetInfo();
|
#define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##TargetInfo();
|
||||||
#include "llvm/Config/Targets.def"
|
#include "llvm/Config/Targets.def"
|
||||||
}
|
}
|
||||||
|
|
||||||
/// InitializeAllTargets - The main program should call this function if it
|
/// InitializeAllTargets - The main program should call this function if it
|
||||||
/// wants access to all available target machines that LLVM is configured to
|
/// wants access to all available target machines that LLVM is configured to
|
||||||
/// support, to make them available via the TargetRegistry.
|
/// support, to make them available via the TargetRegistry.
|
||||||
@ -67,7 +67,7 @@ namespace llvm {
|
|||||||
#define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##Target();
|
#define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##Target();
|
||||||
#include "llvm/Config/Targets.def"
|
#include "llvm/Config/Targets.def"
|
||||||
}
|
}
|
||||||
|
|
||||||
/// InitializeAllTargetMCs - The main program should call this function if it
|
/// InitializeAllTargetMCs - The main program should call this function if it
|
||||||
/// wants access to all available target MC that LLVM is configured to
|
/// wants access to all available target MC that LLVM is configured to
|
||||||
/// support, to make them available via the TargetRegistry.
|
/// support, to make them available via the TargetRegistry.
|
||||||
@ -77,7 +77,7 @@ namespace llvm {
|
|||||||
#define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##TargetMC();
|
#define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##TargetMC();
|
||||||
#include "llvm/Config/Targets.def"
|
#include "llvm/Config/Targets.def"
|
||||||
}
|
}
|
||||||
|
|
||||||
/// InitializeAllAsmPrinters - The main program should call this function if
|
/// InitializeAllAsmPrinters - The main program should call this function if
|
||||||
/// it wants all asm printers that LLVM is configured to support, to make them
|
/// it wants all asm printers that LLVM is configured to support, to make them
|
||||||
/// available via the TargetRegistry.
|
/// available via the TargetRegistry.
|
||||||
@ -87,7 +87,7 @@ namespace llvm {
|
|||||||
#define LLVM_ASM_PRINTER(TargetName) LLVMInitialize##TargetName##AsmPrinter();
|
#define LLVM_ASM_PRINTER(TargetName) LLVMInitialize##TargetName##AsmPrinter();
|
||||||
#include "llvm/Config/AsmPrinters.def"
|
#include "llvm/Config/AsmPrinters.def"
|
||||||
}
|
}
|
||||||
|
|
||||||
/// InitializeAllAsmParsers - The main program should call this function if it
|
/// InitializeAllAsmParsers - The main program should call this function if it
|
||||||
/// wants all asm parsers that LLVM is configured to support, to make them
|
/// wants all asm parsers that LLVM is configured to support, to make them
|
||||||
/// available via the TargetRegistry.
|
/// available via the TargetRegistry.
|
||||||
@ -97,7 +97,7 @@ namespace llvm {
|
|||||||
#define LLVM_ASM_PARSER(TargetName) LLVMInitialize##TargetName##AsmParser();
|
#define LLVM_ASM_PARSER(TargetName) LLVMInitialize##TargetName##AsmParser();
|
||||||
#include "llvm/Config/AsmParsers.def"
|
#include "llvm/Config/AsmParsers.def"
|
||||||
}
|
}
|
||||||
|
|
||||||
/// InitializeAllDisassemblers - The main program should call this function if
|
/// InitializeAllDisassemblers - The main program should call this function if
|
||||||
/// it wants all disassemblers that LLVM is configured to support, to make
|
/// it wants all disassemblers that LLVM is configured to support, to make
|
||||||
/// them available via the TargetRegistry.
|
/// them available via the TargetRegistry.
|
||||||
@ -107,9 +107,9 @@ namespace llvm {
|
|||||||
#define LLVM_DISASSEMBLER(TargetName) LLVMInitialize##TargetName##Disassembler();
|
#define LLVM_DISASSEMBLER(TargetName) LLVMInitialize##TargetName##Disassembler();
|
||||||
#include "llvm/Config/Disassemblers.def"
|
#include "llvm/Config/Disassemblers.def"
|
||||||
}
|
}
|
||||||
|
|
||||||
/// InitializeNativeTarget - The main program should call this function to
|
/// InitializeNativeTarget - The main program should call this function to
|
||||||
/// initialize the native target corresponding to the host. This is useful
|
/// initialize the native target corresponding to the host. This is useful
|
||||||
/// for JIT applications to ensure that the target gets linked in correctly.
|
/// for JIT applications to ensure that the target gets linked in correctly.
|
||||||
///
|
///
|
||||||
/// It is legal for a client to make multiple calls to this function.
|
/// It is legal for a client to make multiple calls to this function.
|
||||||
@ -123,7 +123,7 @@ namespace llvm {
|
|||||||
#else
|
#else
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// InitializeNativeTargetAsmPrinter - The main program should call
|
/// InitializeNativeTargetAsmPrinter - The main program should call
|
||||||
/// this function to initialize the native target asm printer.
|
/// this function to initialize the native target asm printer.
|
||||||
@ -135,7 +135,7 @@ namespace llvm {
|
|||||||
#else
|
#else
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// InitializeNativeTargetAsmParser - The main program should call
|
/// InitializeNativeTargetAsmParser - The main program should call
|
||||||
/// this function to initialize the native target asm parser.
|
/// this function to initialize the native target asm parser.
|
||||||
@ -147,7 +147,7 @@ namespace llvm {
|
|||||||
#else
|
#else
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// InitializeNativeTargetDisassembler - The main program should call
|
/// InitializeNativeTargetDisassembler - The main program should call
|
||||||
/// this function to initialize the native target disassembler.
|
/// this function to initialize the native target disassembler.
|
||||||
|
@ -21,7 +21,7 @@ namespace llvm {
|
|||||||
bool llvm_is_multithreaded();
|
bool llvm_is_multithreaded();
|
||||||
|
|
||||||
/// llvm_execute_on_thread - Execute the given \p UserFn on a separate
|
/// llvm_execute_on_thread - Execute the given \p UserFn on a separate
|
||||||
/// thread, passing it the provided \p UserData and waits for thread
|
/// thread, passing it the provided \p UserData and waits for thread
|
||||||
/// completion.
|
/// completion.
|
||||||
///
|
///
|
||||||
/// This function does not guarantee that the code will actually be executed
|
/// This function does not guarantee that the code will actually be executed
|
||||||
|
@ -30,13 +30,13 @@ class TimeRecord {
|
|||||||
ssize_t MemUsed; // Memory allocated (in bytes)
|
ssize_t MemUsed; // Memory allocated (in bytes)
|
||||||
public:
|
public:
|
||||||
TimeRecord() : WallTime(0), UserTime(0), SystemTime(0), MemUsed(0) {}
|
TimeRecord() : WallTime(0), UserTime(0), SystemTime(0), MemUsed(0) {}
|
||||||
|
|
||||||
/// getCurrentTime - Get the current time and memory usage. If Start is true
|
/// getCurrentTime - Get the current time and memory usage. If Start is true
|
||||||
/// we get the memory usage before the time, otherwise we get time before
|
/// we get the memory usage before the time, otherwise we get time before
|
||||||
/// memory usage. This matters if the time to get the memory usage is
|
/// memory usage. This matters if the time to get the memory usage is
|
||||||
/// significant and shouldn't be counted as part of a duration.
|
/// significant and shouldn't be counted as part of a duration.
|
||||||
static TimeRecord getCurrentTime(bool Start = true);
|
static TimeRecord getCurrentTime(bool Start = true);
|
||||||
|
|
||||||
double getProcessTime() const { return UserTime+SystemTime; }
|
double getProcessTime() const { return UserTime+SystemTime; }
|
||||||
double getUserTime() const { return UserTime; }
|
double getUserTime() const { return UserTime; }
|
||||||
double getSystemTime() const { return SystemTime; }
|
double getSystemTime() const { return SystemTime; }
|
||||||
@ -48,7 +48,7 @@ public:
|
|||||||
// Sort by Wall Time elapsed, as it is the only thing really accurate
|
// Sort by Wall Time elapsed, as it is the only thing really accurate
|
||||||
return WallTime < T.WallTime;
|
return WallTime < T.WallTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator+=(const TimeRecord &RHS) {
|
void operator+=(const TimeRecord &RHS) {
|
||||||
WallTime += RHS.WallTime;
|
WallTime += RHS.WallTime;
|
||||||
UserTime += RHS.UserTime;
|
UserTime += RHS.UserTime;
|
||||||
@ -61,12 +61,12 @@ public:
|
|||||||
SystemTime -= RHS.SystemTime;
|
SystemTime -= RHS.SystemTime;
|
||||||
MemUsed -= RHS.MemUsed;
|
MemUsed -= RHS.MemUsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// print - Print the current timer to standard error, and reset the "Started"
|
/// print - Print the current timer to standard error, and reset the "Started"
|
||||||
/// flag.
|
/// flag.
|
||||||
void print(const TimeRecord &Total, raw_ostream &OS) const;
|
void print(const TimeRecord &Total, raw_ostream &OS) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Timer - This class is used to track the amount of time spent between
|
/// Timer - This class is used to track the amount of time spent between
|
||||||
/// invocations of its startTimer()/stopTimer() methods. Given appropriate OS
|
/// invocations of its startTimer()/stopTimer() methods. Given appropriate OS
|
||||||
/// support it can also keep track of the RSS of the program at various points.
|
/// support it can also keep track of the RSS of the program at various points.
|
||||||
@ -80,7 +80,7 @@ class Timer {
|
|||||||
std::string Name; // The name of this time variable.
|
std::string Name; // The name of this time variable.
|
||||||
bool Started; // Has this time variable ever been started?
|
bool Started; // Has this time variable ever been started?
|
||||||
TimerGroup *TG; // The TimerGroup this Timer is in.
|
TimerGroup *TG; // The TimerGroup this Timer is in.
|
||||||
|
|
||||||
Timer **Prev, *Next; // Doubly linked list of timers in the group.
|
Timer **Prev, *Next; // Doubly linked list of timers in the group.
|
||||||
public:
|
public:
|
||||||
explicit Timer(StringRef N) : TG(nullptr) { init(N); }
|
explicit Timer(StringRef N) : TG(nullptr) { init(N); }
|
||||||
@ -98,10 +98,10 @@ public:
|
|||||||
explicit Timer() : TG(nullptr) {}
|
explicit Timer() : TG(nullptr) {}
|
||||||
void init(StringRef N);
|
void init(StringRef N);
|
||||||
void init(StringRef N, TimerGroup &tg);
|
void init(StringRef N, TimerGroup &tg);
|
||||||
|
|
||||||
const std::string &getName() const { return Name; }
|
const std::string &getName() const { return Name; }
|
||||||
bool isInitialized() const { return TG != nullptr; }
|
bool isInitialized() const { return TG != nullptr; }
|
||||||
|
|
||||||
/// startTimer - Start the timer running. Time between calls to
|
/// startTimer - Start the timer running. Time between calls to
|
||||||
/// startTimer/stopTimer is counted by the Timer class. Note that these calls
|
/// startTimer/stopTimer is counted by the Timer class. Note that these calls
|
||||||
/// must be correctly paired.
|
/// must be correctly paired.
|
||||||
@ -158,7 +158,7 @@ class TimerGroup {
|
|||||||
std::string Name;
|
std::string Name;
|
||||||
Timer *FirstTimer; // First timer in the group.
|
Timer *FirstTimer; // First timer in the group.
|
||||||
std::vector<std::pair<TimeRecord, std::string> > TimersToPrint;
|
std::vector<std::pair<TimeRecord, std::string> > TimersToPrint;
|
||||||
|
|
||||||
TimerGroup **Prev, *Next; // Doubly linked list of TimerGroup's.
|
TimerGroup **Prev, *Next; // Doubly linked list of TimerGroup's.
|
||||||
TimerGroup(const TimerGroup &TG) = delete;
|
TimerGroup(const TimerGroup &TG) = delete;
|
||||||
void operator=(const TimerGroup &TG) = delete;
|
void operator=(const TimerGroup &TG) = delete;
|
||||||
@ -171,10 +171,10 @@ public:
|
|||||||
|
|
||||||
/// print - Print any started timers in this group and zero them.
|
/// print - Print any started timers in this group and zero them.
|
||||||
void print(raw_ostream &OS);
|
void print(raw_ostream &OS);
|
||||||
|
|
||||||
/// printAll - This static method prints all timers and clears them all out.
|
/// printAll - This static method prints all timers and clears them all out.
|
||||||
static void printAll(raw_ostream &OS);
|
static void printAll(raw_ostream &OS);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class Timer;
|
friend class Timer;
|
||||||
void addTimer(Timer &T);
|
void addTimer(Timer &T);
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
|
|
||||||
namespace llvm
|
namespace llvm
|
||||||
{
|
{
|
||||||
/// circular_raw_ostream - A raw_ostream which *can* save its data
|
/// circular_raw_ostream - A raw_ostream which *can* save its data
|
||||||
/// to a circular buffer, or can pass it through directly to an
|
/// to a circular buffer, or can pass it through directly to an
|
||||||
|
@ -218,10 +218,10 @@ public:
|
|||||||
|
|
||||||
// Formatted output, see the leftJustify() function in Support/Format.h.
|
// Formatted output, see the leftJustify() function in Support/Format.h.
|
||||||
raw_ostream &operator<<(const FormattedString &);
|
raw_ostream &operator<<(const FormattedString &);
|
||||||
|
|
||||||
// Formatted output, see the formatHex() function in Support/Format.h.
|
// Formatted output, see the formatHex() function in Support/Format.h.
|
||||||
raw_ostream &operator<<(const FormattedNumber &);
|
raw_ostream &operator<<(const FormattedNumber &);
|
||||||
|
|
||||||
/// indent - Insert 'NumSpaces' spaces.
|
/// indent - Insert 'NumSpaces' spaces.
|
||||||
raw_ostream &indent(unsigned NumSpaces);
|
raw_ostream &indent(unsigned NumSpaces);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user