summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-12 20:07:59 +0000
committerChris Lattner <sabre@nondot.org>2009-04-12 20:07:59 +0000
commit423bcb53f736cc6250f4106c98d6c1cbe267dd46 (patch)
tree83deb79f983fff8b7a2989087289e8a207d54422
parent6cd82fb430f3fd83aee15a9dad4dc16b85440990 (diff)
downloadbcm5719-llvm-423bcb53f736cc6250f4106c98d6c1cbe267dd46.tar.gz
bcm5719-llvm-423bcb53f736cc6250f4106c98d6c1cbe267dd46.zip
add a new Decl::hasAttr<T>() predicate.
llvm-svn: 68907
-rw-r--r--clang/include/clang/AST/DeclBase.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/include/clang/AST/DeclBase.h b/clang/include/clang/AST/DeclBase.h
index d05b5a597eb..7f427e3eb3a 100644
--- a/clang/include/clang/AST/DeclBase.h
+++ b/clang/include/clang/AST/DeclBase.h
@@ -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; }
OpenPOWER on IntegriCloud