diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-07-24 23:45:00 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-07-24 23:45:00 +0000 |
commit | 9b344d920f6b3496885094bd2f364453cb8d968f (patch) | |
tree | e6e3592489d0e2db383f88833fd43340f329b319 /include | |
parent | a280a839f5c335b6ac1db61c6aa125dcd43b9869 (diff) | |
download | external_llvm-9b344d920f6b3496885094bd2f364453cb8d968f.zip external_llvm-9b344d920f6b3496885094bd2f364453cb8d968f.tar.gz external_llvm-9b344d920f6b3496885094bd2f364453cb8d968f.tar.bz2 |
Add helpful accessor methods to get the specified function attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187088 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/IR/Function.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/include/llvm/IR/Function.h b/include/llvm/IR/Function.h index 455469d..970e7f8 100644 --- a/include/llvm/IR/Function.h +++ b/include/llvm/IR/Function.h @@ -166,37 +166,32 @@ public: (static_cast<unsigned>(CC) << 1)); } - /// getAttributes - Return the attribute list for this Function. - /// + /// @brief Return the attribute list for this Function. AttributeSet getAttributes() const { return AttributeSets; } - /// setAttributes - Set the attribute list for this Function. - /// + /// @brief Set the attribute list for this Function. void setAttributes(AttributeSet attrs) { AttributeSets = attrs; } - /// addFnAttr - Add function attributes to this function. - /// + /// @brief Add function attributes to this function. void addFnAttr(Attribute::AttrKind N) { setAttributes(AttributeSets.addAttribute(getContext(), AttributeSet::FunctionIndex, N)); } - /// removeFnAttr - Remove function attributes from this function. - /// + /// @brief Remove function attributes from this function. void removeFnAttr(Attribute::AttrKind N) { setAttributes(AttributeSets.removeAttribute( getContext(), AttributeSet::FunctionIndex, N)); } - /// addFnAttr - Add function attributes to this function. - /// + /// @brief 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. + /// @brief Return true if the function has the attribute. bool hasFnAttribute(Attribute::AttrKind Kind) const { return AttributeSets.hasAttribute(AttributeSet::FunctionIndex, Kind); } @@ -204,6 +199,14 @@ public: return AttributeSets.hasAttribute(AttributeSet::FunctionIndex, Kind); } + /// @brief Return the attribute for the given attribute kind. + Attribute getFnAttribute(Attribute::AttrKind Kind) const { + return AttributeSets.getAttribute(AttributeSet::FunctionIndex, Kind); + } + Attribute getFnAttribute(StringRef Kind) const { + return AttributeSets.getAttribute(AttributeSet::FunctionIndex, Kind); + } + /// hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm /// to use during code generation. bool hasGC() const; |