diff options
Diffstat (limited to 'include/llvm/IR/Function.h')
-rw-r--r-- | include/llvm/IR/Function.h | 8 |
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); |