mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-28 15:38:57 +00:00
Reorder some functions and add comments. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173733 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c0b3d4c9c2
commit
c22f4aa886
@ -107,6 +107,10 @@ private:
|
|||||||
public:
|
public:
|
||||||
Attribute() : pImpl(0) {}
|
Attribute() : pImpl(0) {}
|
||||||
|
|
||||||
|
//===--------------------------------------------------------------------===//
|
||||||
|
// Attribute Construction
|
||||||
|
//===--------------------------------------------------------------------===//
|
||||||
|
|
||||||
/// \brief Return a uniquified Attribute object.
|
/// \brief Return a uniquified Attribute object.
|
||||||
static Attribute get(LLVMContext &Context, AttrKind Kind);
|
static Attribute get(LLVMContext &Context, AttrKind Kind);
|
||||||
static Attribute get(LLVMContext &Context, AttrBuilder &B);
|
static Attribute get(LLVMContext &Context, AttrBuilder &B);
|
||||||
@ -116,6 +120,10 @@ public:
|
|||||||
static Attribute getWithAlignment(LLVMContext &Context, uint64_t Align);
|
static Attribute getWithAlignment(LLVMContext &Context, uint64_t Align);
|
||||||
static Attribute getWithStackAlignment(LLVMContext &Context, uint64_t Align);
|
static Attribute getWithStackAlignment(LLVMContext &Context, uint64_t Align);
|
||||||
|
|
||||||
|
//===--------------------------------------------------------------------===//
|
||||||
|
// Attribute Accessors
|
||||||
|
//===--------------------------------------------------------------------===//
|
||||||
|
|
||||||
/// \brief Return true if the attribute is present.
|
/// \brief Return true if the attribute is present.
|
||||||
bool hasAttribute(AttrKind Val) const;
|
bool hasAttribute(AttrKind Val) const;
|
||||||
|
|
||||||
@ -130,6 +138,10 @@ public:
|
|||||||
/// alignment value.
|
/// alignment value.
|
||||||
unsigned getStackAlignment() const;
|
unsigned getStackAlignment() const;
|
||||||
|
|
||||||
|
/// \brief The Attribute is converted to a string of equivalent mnemonic. This
|
||||||
|
/// is, presumably, for writing out the mnemonics for the assembly writer.
|
||||||
|
std::string getAsString() const;
|
||||||
|
|
||||||
/// \brief Equality and non-equality query methods.
|
/// \brief Equality and non-equality query methods.
|
||||||
bool operator==(AttrKind K) const;
|
bool operator==(AttrKind K) const;
|
||||||
bool operator!=(AttrKind K) const;
|
bool operator!=(AttrKind K) const;
|
||||||
@ -140,37 +152,14 @@ public:
|
|||||||
/// \brief Less-than operator. Useful for sorting the attributes list.
|
/// \brief Less-than operator. Useful for sorting the attributes list.
|
||||||
bool operator<(Attribute A) const;
|
bool operator<(Attribute A) const;
|
||||||
|
|
||||||
/// \brief The Attribute is converted to a string of equivalent mnemonic. This
|
|
||||||
/// is, presumably, for writing out the mnemonics for the assembly writer.
|
|
||||||
std::string getAsString() const;
|
|
||||||
|
|
||||||
void Profile(FoldingSetNodeID &ID) const {
|
void Profile(FoldingSetNodeID &ID) const {
|
||||||
ID.AddPointer(pImpl);
|
ID.AddPointer(pImpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: Remove this.
|
||||||
uint64_t Raw() const;
|
uint64_t Raw() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
/// \class
|
|
||||||
/// \brief Provide DenseMapInfo for Attribute::AttrKinds. This is used by
|
|
||||||
/// AttrBuilder.
|
|
||||||
template<> struct DenseMapInfo<Attribute::AttrKind> {
|
|
||||||
static inline Attribute::AttrKind getEmptyKey() {
|
|
||||||
return Attribute::AttrKindEmptyKey;
|
|
||||||
}
|
|
||||||
static inline Attribute::AttrKind getTombstoneKey() {
|
|
||||||
return Attribute::AttrKindTombstoneKey;
|
|
||||||
}
|
|
||||||
static unsigned getHashValue(const Attribute::AttrKind &Val) {
|
|
||||||
return Val * 37U;
|
|
||||||
}
|
|
||||||
static bool isEqual(const Attribute::AttrKind &LHS,
|
|
||||||
const Attribute::AttrKind &RHS) {
|
|
||||||
return LHS == RHS;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// AttributeSet Smart Pointer
|
// AttributeSet Smart Pointer
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
@ -223,7 +212,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
// Attribute List Construction and Mutation
|
// AttributeSet Construction and Mutation
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
|
|
||||||
/// \brief Return an AttributeSet with the specified parameters in it.
|
/// \brief Return an AttributeSet with the specified parameters in it.
|
||||||
@ -267,7 +256,7 @@ public:
|
|||||||
AttributeSet Attrs) const;
|
AttributeSet Attrs) const;
|
||||||
|
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
// Attribute Set Accessors
|
// AttributeSet Accessors
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
|
|
||||||
/// \brief The attributes for the specified index are returned.
|
/// \brief The attributes for the specified index are returned.
|
||||||
@ -285,6 +274,10 @@ public:
|
|||||||
/// \brief Return true if attribute exists at the given index.
|
/// \brief Return true if attribute exists at the given index.
|
||||||
bool hasAttributes(unsigned Index) const;
|
bool hasAttributes(unsigned Index) const;
|
||||||
|
|
||||||
|
/// \brief Return true if the specified attribute is set for at least one
|
||||||
|
/// parameter or for the return value.
|
||||||
|
bool hasAttrSomewhere(Attribute::AttrKind Attr) const;
|
||||||
|
|
||||||
/// \brief Return the alignment for the specified function parameter.
|
/// \brief Return the alignment for the specified function parameter.
|
||||||
unsigned getParamAlignment(unsigned Idx) const;
|
unsigned getParamAlignment(unsigned Idx) const;
|
||||||
|
|
||||||
@ -294,12 +287,6 @@ public:
|
|||||||
/// \brief Return the attributes at the index as a string.
|
/// \brief Return the attributes at the index as a string.
|
||||||
std::string getAsString(unsigned Index) const;
|
std::string getAsString(unsigned Index) const;
|
||||||
|
|
||||||
uint64_t Raw(unsigned Index) const;
|
|
||||||
|
|
||||||
/// \brief Return true if the specified attribute is set for at least one
|
|
||||||
/// parameter or for the return value.
|
|
||||||
bool hasAttrSomewhere(Attribute::AttrKind Attr) const;
|
|
||||||
|
|
||||||
/// operator==/!= - Provide equality predicates.
|
/// operator==/!= - Provide equality predicates.
|
||||||
bool operator==(const AttributeSet &RHS) const {
|
bool operator==(const AttributeSet &RHS) const {
|
||||||
return pImpl == RHS.pImpl;
|
return pImpl == RHS.pImpl;
|
||||||
@ -309,18 +296,17 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
// Attribute List Introspection
|
// AttributeSet Introspection
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
// FIXME: Remove this.
|
||||||
|
uint64_t Raw(unsigned Index) const;
|
||||||
|
|
||||||
/// \brief Return a raw pointer that uniquely identifies this attribute list.
|
/// \brief Return a raw pointer that uniquely identifies this attribute list.
|
||||||
void *getRawPointer() const {
|
void *getRawPointer() const {
|
||||||
return pImpl;
|
return pImpl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attributes are stored as a dense set of slots, where there is one slot for
|
|
||||||
// each argument that has an attribute. This allows walking over the dense
|
|
||||||
// set instead of walking the sparse list of attributes.
|
|
||||||
|
|
||||||
/// \brief Return true if there are no attributes.
|
/// \brief Return true if there are no attributes.
|
||||||
bool isEmpty() const {
|
bool isEmpty() const {
|
||||||
return pImpl == 0;
|
return pImpl == 0;
|
||||||
@ -340,6 +326,26 @@ public:
|
|||||||
void dump() const;
|
void dump() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
/// \class
|
||||||
|
/// \brief Provide DenseMapInfo for Attribute::AttrKinds. This is used by
|
||||||
|
/// AttrBuilder.
|
||||||
|
template<> struct DenseMapInfo<Attribute::AttrKind> {
|
||||||
|
static inline Attribute::AttrKind getEmptyKey() {
|
||||||
|
return Attribute::AttrKindEmptyKey;
|
||||||
|
}
|
||||||
|
static inline Attribute::AttrKind getTombstoneKey() {
|
||||||
|
return Attribute::AttrKindTombstoneKey;
|
||||||
|
}
|
||||||
|
static unsigned getHashValue(const Attribute::AttrKind &Val) {
|
||||||
|
return Val * 37U;
|
||||||
|
}
|
||||||
|
static bool isEqual(const Attribute::AttrKind &LHS,
|
||||||
|
const Attribute::AttrKind &RHS) {
|
||||||
|
return LHS == RHS;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
/// \class
|
/// \class
|
||||||
/// \brief This class is used in conjunction with the Attribute::get method to
|
/// \brief This class is used in conjunction with the Attribute::get method to
|
||||||
@ -407,17 +413,11 @@ public:
|
|||||||
typedef DenseSet<Attribute::AttrKind>::iterator iterator;
|
typedef DenseSet<Attribute::AttrKind>::iterator iterator;
|
||||||
typedef DenseSet<Attribute::AttrKind>::const_iterator const_iterator;
|
typedef DenseSet<Attribute::AttrKind>::const_iterator const_iterator;
|
||||||
|
|
||||||
iterator begin() { return Attrs.begin(); }
|
iterator begin() { return Attrs.begin(); }
|
||||||
iterator end() { return Attrs.end(); }
|
iterator end() { return Attrs.end(); }
|
||||||
|
|
||||||
const_iterator begin() const { return Attrs.begin(); }
|
const_iterator begin() const { return Attrs.begin(); }
|
||||||
const_iterator end() const { return Attrs.end(); }
|
const_iterator end() const { return Attrs.end(); }
|
||||||
|
|
||||||
/// \brief Add the raw value to the internal representation.
|
|
||||||
///
|
|
||||||
/// N.B. This should be used ONLY for decoding LLVM bitcode!
|
|
||||||
AttrBuilder &addRawValue(uint64_t Val);
|
|
||||||
|
|
||||||
/// \brief Remove attributes that are used on functions only.
|
/// \brief Remove attributes that are used on functions only.
|
||||||
void removeFunctionOnlyAttrs() {
|
void removeFunctionOnlyAttrs() {
|
||||||
removeAttribute(Attribute::NoReturn)
|
removeAttribute(Attribute::NoReturn)
|
||||||
@ -443,12 +443,19 @@ public:
|
|||||||
.removeAttribute(Attribute::NoDuplicate);
|
.removeAttribute(Attribute::NoDuplicate);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t Raw() const;
|
|
||||||
|
|
||||||
bool operator==(const AttrBuilder &B);
|
bool operator==(const AttrBuilder &B);
|
||||||
bool operator!=(const AttrBuilder &B) {
|
bool operator!=(const AttrBuilder &B) {
|
||||||
return !(*this == B);
|
return !(*this == B);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: Remove these.
|
||||||
|
|
||||||
|
/// \brief Add the raw value to the internal representation.
|
||||||
|
///
|
||||||
|
/// N.B. This should be used ONLY for decoding LLVM bitcode!
|
||||||
|
AttrBuilder &addRawValue(uint64_t Val);
|
||||||
|
|
||||||
|
uint64_t Raw() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace AttributeFuncs {
|
namespace AttributeFuncs {
|
||||||
|
@ -37,20 +37,19 @@ class AttributeImpl : public FoldingSetNode {
|
|||||||
void operator=(const AttributeImpl &) LLVM_DELETED_FUNCTION;
|
void operator=(const AttributeImpl &) LLVM_DELETED_FUNCTION;
|
||||||
AttributeImpl(const AttributeImpl &) LLVM_DELETED_FUNCTION;
|
AttributeImpl(const AttributeImpl &) LLVM_DELETED_FUNCTION;
|
||||||
public:
|
public:
|
||||||
explicit AttributeImpl(LLVMContext &C, uint64_t data);
|
AttributeImpl(LLVMContext &C, Constant *Data)
|
||||||
|
: Context(C), Data(Data) {}
|
||||||
explicit AttributeImpl(LLVMContext &C, Attribute::AttrKind data);
|
explicit AttributeImpl(LLVMContext &C, Attribute::AttrKind data);
|
||||||
AttributeImpl(LLVMContext &C, Attribute::AttrKind data,
|
AttributeImpl(LLVMContext &C, Attribute::AttrKind data,
|
||||||
ArrayRef<Constant*> values);
|
ArrayRef<Constant*> values);
|
||||||
AttributeImpl(LLVMContext &C, StringRef data);
|
AttributeImpl(LLVMContext &C, StringRef data);
|
||||||
|
|
||||||
LLVMContext &getContext() { return Context; }
|
|
||||||
|
|
||||||
ArrayRef<Constant*> getValues() const { return Vals; }
|
|
||||||
|
|
||||||
bool hasAttribute(Attribute::AttrKind A) const;
|
bool hasAttribute(Attribute::AttrKind A) const;
|
||||||
|
|
||||||
bool hasAttributes() const;
|
bool hasAttributes() const;
|
||||||
|
|
||||||
|
LLVMContext &getContext() { return Context; }
|
||||||
|
ArrayRef<Constant*> getValues() const { return Vals; }
|
||||||
|
|
||||||
uint64_t getAlignment() const;
|
uint64_t getAlignment() const;
|
||||||
uint64_t getStackAlignment() const;
|
uint64_t getStackAlignment() const;
|
||||||
|
|
||||||
@ -62,15 +61,19 @@ public:
|
|||||||
|
|
||||||
bool operator<(const AttributeImpl &AI) const;
|
bool operator<(const AttributeImpl &AI) const;
|
||||||
|
|
||||||
uint64_t Raw() const; // FIXME: Remove.
|
|
||||||
|
|
||||||
static uint64_t getAttrMask(Attribute::AttrKind Val);
|
|
||||||
|
|
||||||
void Profile(FoldingSetNodeID &ID) const {
|
void Profile(FoldingSetNodeID &ID) const {
|
||||||
Profile(ID, Data, Vals);
|
Profile(ID, Data, Vals);
|
||||||
}
|
}
|
||||||
static void Profile(FoldingSetNodeID &ID, Constant *Data,
|
static void Profile(FoldingSetNodeID &ID, Constant *Data,
|
||||||
ArrayRef<Constant*> Vals);
|
ArrayRef<Constant*> Vals) {
|
||||||
|
ID.AddPointer(Data);
|
||||||
|
for (unsigned I = 0, E = Vals.size(); I != E; ++I)
|
||||||
|
ID.AddPointer(Vals[I]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// FIXME: Remove these!
|
||||||
|
uint64_t Raw() const;
|
||||||
|
static uint64_t getAttrMask(Attribute::AttrKind Val);
|
||||||
};
|
};
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user