]> granicus.if.org Git - clang/commitdiff
add a new Decl::hasAttr<T>() predicate.
authorChris Lattner <sabre@nondot.org>
Sun, 12 Apr 2009 20:07:59 +0000 (20:07 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 12 Apr 2009 20:07:59 +0000 (20:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68907 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclBase.h

index d05b5a597eb5dc1328ee43d3b78aeca6b46508d3..7f427e3eb3a68444550043d72c81b32158ecd21f 100644 (file)
@@ -223,6 +223,10 @@ public:
     return 0;
   }
     
+  template<typename T> bool hasAttr() const {
+    return getAttr<T>() != 0;
+  }
+  
   /// setInvalidDecl - Indicates the Decl had a semantic error. This
   /// allows for graceful error recovery.
   void setInvalidDecl(bool Invalid = true) { InvalidDecl = Invalid; }