diff options
| author | Bill Wendling <isanbard@gmail.com> | 2013-02-18 23:16:42 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2013-02-18 23:16:42 +0000 |
| commit | c1f96400137f223a2327e87e704de51008240dc3 (patch) | |
| tree | 992a3a90b4a72c141f9cce345b89c109cf819332 /llvm | |
| parent | 9f02e0912d0cb1b3fd39cb25e3b709128f9f3a63 (diff) | |
| download | bcm5719-llvm-c1f96400137f223a2327e87e704de51008240dc3.tar.gz bcm5719-llvm-c1f96400137f223a2327e87e704de51008240dc3.zip | |
Add some convenience methods for querying function attributes.
llvm-svn: 175469
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/IR/Function.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/include/llvm/IR/Function.h b/llvm/include/llvm/IR/Function.h index f7d5a48d204..568b55c87b9 100644 --- a/llvm/include/llvm/IR/Function.h +++ b/llvm/include/llvm/IR/Function.h @@ -175,6 +175,14 @@ public: AttributeSet::FunctionIndex, N)); } + /// \brief Return true if the function has the attribute. + bool hasFnAttribute(Attribute::AttrKind Kind) const { + return AttributeSets.hasAttribute(AttributeSet::FunctionIndex, Kind); + } + bool hasFnAttribute(StringRef Kind) const { + return AttributeSets.hasAttribute(AttributeSet::FunctionIndex, Kind); + } + /// hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm /// to use during code generation. bool hasGC() const; |

