aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/llvm/IR/Attributes.h7
-rw-r--r--lib/IR/Attributes.cpp8
2 files changed, 15 insertions, 0 deletions
diff --git a/include/llvm/IR/Attributes.h b/include/llvm/IR/Attributes.h
index 1578789..5ebb629 100644
--- a/include/llvm/IR/Attributes.h
+++ b/include/llvm/IR/Attributes.h
@@ -28,6 +28,7 @@ class AttrBuilder;
class AttributeImpl;
class AttributeSetImpl;
class AttributeSetNode;
+class Constant;
class LLVMContext;
class Type;
@@ -130,6 +131,12 @@ public:
/// \brief Return true if attributes exist
bool hasAttributes() const;
+ /// \brief Return the kind of this attribute.
+ Constant *getAttributeKind() const;
+
+ /// \brief Return the value (if present) of the non-target-specific attribute.
+ ArrayRef<Constant*> getAttributeValues() const;
+
/// \brief Returns the alignment field of an attribute as a byte alignment
/// value.
unsigned getAlignment() const;
diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp
index a3f62ae..1a97110 100644
--- a/lib/IR/Attributes.cpp
+++ b/lib/IR/Attributes.cpp
@@ -83,6 +83,14 @@ bool Attribute::hasAttributes() const {
return pImpl && pImpl->hasAttributes();
}
+Constant *Attribute::getAttributeKind() const {
+ return pImpl ? pImpl->getAttributeKind() : 0;
+}
+
+ArrayRef<Constant*> Attribute::getAttributeValues() const {
+ return pImpl ? pImpl->getAttributeValues() : ArrayRef<Constant*>();
+}
+
/// This returns the alignment field of an attribute as a byte alignment value.
unsigned Attribute::getAlignment() const {
if (!hasAttribute(Attribute::Alignment))