projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pr20588: add missing calls to va_end.
[oota-llvm.git]
/
lib
/
IR
/
AttributeImpl.h
diff --git
a/lib/IR/AttributeImpl.h
b/lib/IR/AttributeImpl.h
index 9da3f9659e035ac397fb572b91e399a2a41ecb2d..cc6d557ab4c7d1c6568705afab874dc0b92f5dd2 100644
(file)
--- a/
lib/IR/AttributeImpl.h
+++ b/
lib/IR/AttributeImpl.h
@@
-39,7
+39,7
@@
class 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());
@@
-94,6
+94,7
@@
public:
/// attribute enties, which are for target-dependent attributes.
class EnumAttributeImpl : public AttributeImpl {
/// attribute enties, which are for target-dependent attributes.
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 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 StringAttributeImpl : public AttributeImpl {
};
class StringAttributeImpl : public AttributeImpl {
+ virtual void anchor();
std::string Kind;
std::string Val;
std::string Kind;
std::string Val;
@@
-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;