From c1f96400137f223a2327e87e704de51008240dc3 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 18 Feb 2013 23:16:42 +0000 Subject: [PATCH] Add some convenience methods for querying function attributes. llvm-svn: 175469 --- llvm/include/llvm/IR/Function.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/llvm/include/llvm/IR/Function.h b/llvm/include/llvm/IR/Function.h index f7d5a48..568b55c 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; -- 2.7.4