projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[X86][Haswell][SchedModel] Add architecture specific scheduling models.
[oota-llvm.git]
/
lib
/
IR
/
AttributeImpl.h
diff --git
a/lib/IR/AttributeImpl.h
b/lib/IR/AttributeImpl.h
index ac7379b00e7d2ad39ea269faa5dac16bcdd4c8c9..0448dc17409e9e063ccbc34d39b96864fa46b601 100644
(file)
--- a/
lib/IR/AttributeImpl.h
+++ b/
lib/IR/AttributeImpl.h
@@
-13,8
+13,8
@@
///
//===----------------------------------------------------------------------===//
///
//===----------------------------------------------------------------------===//
-#ifndef LLVM_
ATTRIBUTES
IMPL_H
-#define LLVM_
ATTRIBUTES
IMPL_H
+#ifndef LLVM_
LIB_IR_ATTRIBUTE
IMPL_H
+#define LLVM_
LIB_IR_ATTRIBUTE
IMPL_H
#include "llvm/ADT/FoldingSet.h"
#include "llvm/IR/Attributes.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/IR/Attributes.h"
@@
-29,7
+29,7
@@
class LLVMContext;
/// \class
/// \brief This class represents a single, uniqued attribute. That attribute
/// could be a single enum, a tuple, or a string.
/// \class
/// \brief This class represents a single, uniqued attribute. That attribute
/// could be a single enum, a tuple, or a string.
-class
LLVM_LIBRARY_VISIBILITY
AttributeImpl : public FoldingSetNode {
+class AttributeImpl : public FoldingSetNode {
unsigned char KindID; ///< Holds the AttrEntryKind of the attribute
// AttributesImpl is uniqued, these should not be publicly available.
unsigned char KindID; ///< Holds the AttrEntryKind of the attribute
// AttributesImpl is uniqued, these should not be publicly available.
@@
-39,7
+39,7
@@
class LLVM_LIBRARY_VISIBILITY AttributeImpl : public FoldingSetNode {
protected:
enum AttrEntryKind {
EnumAttrEntry,
protected:
enum AttrEntryKind {
EnumAttrEntry,
-
Align
AttrEntry,
+
Int
AttrEntry,
StringAttrEntry
};
StringAttrEntry
};
@@
-49,7
+49,7
@@
public:
virtual ~AttributeImpl();
bool isEnumAttribute() const { return KindID == EnumAttrEntry; }
virtual ~AttributeImpl();
bool isEnumAttribute() const { return KindID == EnumAttrEntry; }
- bool is
AlignAttribute() const { return KindID == Align
AttrEntry; }
+ bool is
IntAttribute() const { return KindID == Int
AttrEntry; }
bool isStringAttribute() const { return KindID == StringAttrEntry; }
bool hasAttribute(Attribute::AttrKind A) const;
bool isStringAttribute() const { return KindID == StringAttrEntry; }
bool hasAttribute(Attribute::AttrKind A) const;
@@
-67,7
+67,7
@@
public:
void Profile(FoldingSetNodeID &ID) const {
if (isEnumAttribute())
Profile(ID, getKindAsEnum(), 0);
void Profile(FoldingSetNodeID &ID) const {
if (isEnumAttribute())
Profile(ID, getKindAsEnum(), 0);
- else if (is
Align
Attribute())
+ else if (is
Int
Attribute())
Profile(ID, getKindAsEnum(), getValueAsInt());
else
Profile(ID, getKindAsString(), getValueAsString());
Profile(ID, getKindAsEnum(), getValueAsInt());
else
Profile(ID, getKindAsString(), getValueAsString());
@@
-93,7
+93,8
@@
public:
/// represented by Attribute::AttrKind; alignment attribute entries; and string
/// attribute enties, which are for target-dependent attributes.
/// represented by Attribute::AttrKind; alignment attribute entries; and string
/// attribute enties, which are for target-dependent attributes.
-class LLVM_LIBRARY_VISIBILITY EnumAttributeImpl : public AttributeImpl {
+class EnumAttributeImpl : public AttributeImpl {
+ virtual void anchor();
Attribute::AttrKind Kind;
protected:
Attribute::AttrKind Kind;
protected:
@@
-107,21
+108,24
@@
public:
Attribute::AttrKind getEnumKind() const { return Kind; }
};
Attribute::AttrKind getEnumKind() const { return Kind; }
};
-class LLVM_LIBRARY_VISIBILITY AlignAttributeImpl : public EnumAttributeImpl {
- unsigned Align;
+class IntAttributeImpl : public EnumAttributeImpl {
+ void anchor() override;
+ uint64_t Val;
public:
public:
-
AlignAttributeImpl(Attribute::AttrKind Kind, unsigned Align
)
- : EnumAttributeImpl(
AlignAttrEntry, Kind), Align(Align
) {
+
IntAttributeImpl(Attribute::AttrKind Kind, uint64_t Val
)
+ : EnumAttributeImpl(
IntAttrEntry, Kind), Val(Val
) {
assert(
assert(
- (Kind == Attribute::Alignment || Kind == Attribute::StackAlignment) &&
- "Wrong kind for alignment attribute!");
+ (Kind == Attribute::Alignment || Kind == Attribute::StackAlignment ||
+ Kind == Attribute::Dereferenceable) &&
+ "Wrong kind for int attribute!");
}
}
- u
nsigned getAlignment() const { return Align
; }
+ u
int64_t getValue() const { return Val
; }
};
};
-class LLVM_LIBRARY_VISIBILITY StringAttributeImpl : public AttributeImpl {
+class StringAttributeImpl : public AttributeImpl {
+ virtual void anchor();
std::string Kind;
std::string Val;
std::string Kind;
std::string Val;
@@
-137,7
+141,7
@@
public:
/// \class
/// \brief This class represents a group of attributes that apply to one
/// element: function, return type, or parameter.
/// \class
/// \brief This class represents a group of attributes that apply to one
/// element: function, return type, or parameter.
-class
LLVM_LIBRARY_VISIBILITY
AttributeSetNode : public FoldingSetNode {
+class AttributeSetNode : public FoldingSetNode {
unsigned NumAttrs; ///< Number of attributes in this node.
AttributeSetNode(ArrayRef<Attribute> Attrs) : NumAttrs(Attrs.size()) {
unsigned NumAttrs; ///< Number of attributes in this node.
AttributeSetNode(ArrayRef<Attribute> Attrs) : NumAttrs(Attrs.size()) {
@@
-161,6
+165,7
@@
public:
unsigned getAlignment() const;
unsigned getStackAlignment() const;
unsigned getAlignment() const;
unsigned getStackAlignment() const;
+ uint64_t getDereferenceableBytes() const;
std::string getAsString(bool InAttrGrp) const;
typedef const Attribute *iterator;
std::string getAsString(bool InAttrGrp) const;
typedef const Attribute *iterator;
@@
-180,7
+185,7
@@
public:
/// \class
/// \brief This class represents a set of attributes that apply to the function,
/// return type, and parameters.
/// \class
/// \brief This class represents a set of attributes that apply to the function,
/// return type, and parameters.
-class
LLVM_LIBRARY_VISIBILITY
AttributeSetImpl : public FoldingSetNode {
+class AttributeSetImpl : public FoldingSetNode {
friend class AttributeSet;
LLVMContext &Context;
friend class AttributeSet;
LLVMContext &Context;