[llvm] r175469 - Add some convenience methods for querying function attributes.

Bill Wendling isanbard at gmail.com
Mon Feb 18 15:16:42 PST 2013


Author: void
Date: Mon Feb 18 17:16:42 2013
New Revision: 175469

URL: http://llvm.org/viewvc/llvm-project?rev=175469&view=rev
Log:
Add some convenience methods for querying function attributes.

Modified:
    llvm/trunk/include/llvm/IR/Function.h

Modified: llvm/trunk/include/llvm/IR/Function.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Function.h?rev=175469&r1=175468&r2=175469&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Function.h (original)
+++ llvm/trunk/include/llvm/IR/Function.h Mon Feb 18 17:16:42 2013
@@ -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;





More information about the llvm-commits mailing list