aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/IR/Function.h
diff options
context:
space:
mode:
authorReed Kotler <rkotler@mips.com>2013-03-13 20:20:08 +0000
committerReed Kotler <rkotler@mips.com>2013-03-13 20:20:08 +0000
commit9106f73246168fb30d26fb14085c0b3d81fcd350 (patch)
tree9754853200a2e8d629b468eff84d8600b70fb274 /include/llvm/IR/Function.h
parent321aded62349b7369dc999a104944b5304199d83 (diff)
Add some additonal attribute helper functions. Test will be on follow
up putback to clang for mips16. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176968 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/IR/Function.h')
-rw-r--r--include/llvm/IR/Function.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/IR/Function.h b/include/llvm/IR/Function.h
index a7dea5ca3d..f97929f658 100644
--- a/include/llvm/IR/Function.h
+++ b/include/llvm/IR/Function.h
@@ -181,6 +181,14 @@ public:
AttributeSet::FunctionIndex, N));
}
+ /// addFnAttr - Add function attributes to this function.
+ ///
+ void addFnAttr(StringRef Kind) {
+ setAttributes(
+ AttributeSets.addAttribute(getContext(),
+ AttributeSet::FunctionIndex, Kind));
+ }
+
/// \brief Return true if the function has the attribute.
bool hasFnAttribute(Attribute::AttrKind Kind) const {
return AttributeSets.hasAttribute(AttributeSet::FunctionIndex, Kind);