aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-07-25 18:34:24 +0000
committerBill Wendling <isanbard@gmail.com>2013-07-25 18:34:24 +0000
commit3b2f61066cab49457391d7f1570c2a2e2a6d7059 (patch)
tree8a99142dc8f7f11b66a9aa765cc47b147b8aa9c2 /llvm/lib/IR/Attributes.cpp
parentc69e55bd480467de7b6a4824f2cd8f27172a539f (diff)
downloadllvm-3b2f61066cab49457391d7f1570c2a2e2a6d7059.zip
llvm-3b2f61066cab49457391d7f1570c2a2e2a6d7059.tar.gz
llvm-3b2f61066cab49457391d7f1570c2a2e2a6d7059.tar.bz2
Add a way to add a kind-value string pair to an attribute.
llvm-svn: 187138
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r--llvm/lib/IR/Attributes.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 48743fa..894ff7d 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -645,6 +645,13 @@ AttributeSet AttributeSet::addAttribute(LLVMContext &C, unsigned Index,
return addAttributes(C, Index, AttributeSet::get(C, Index, B));
}
+AttributeSet AttributeSet::addAttribute(LLVMContext &C, unsigned Index,
+ StringRef Kind, StringRef Value) const {
+ llvm::AttrBuilder B;
+ B.addAttribute(Kind, Value);
+ return addAttributes(C, Index, AttributeSet::get(C, Index, B));
+}
+
AttributeSet AttributeSet::addAttributes(LLVMContext &C, unsigned Index,
AttributeSet Attrs) const {
if (!pImpl) return Attrs;