]> granicus.if.org Git - clang/commitdiff
clang::Attr objects should be treated as AST nodes as well by
authorTed Kremenek <kremenek@apple.com>
Sun, 14 Feb 2010 22:58:16 +0000 (22:58 +0000)
committerTed Kremenek <kremenek@apple.com>
Sun, 14 Feb 2010 22:58:16 +0000 (22:58 +0000)
the LLVMConventionsChecker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96202 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/LLVMConventionsChecker.cpp

index 242f4de2b6817a560b9b73f42fc48e94cc8879b1..14f0fc1280dfcdd259d78596d21b879ce5c98c1e 100644 (file)
@@ -98,6 +98,10 @@ static bool IsClangStmt(const RecordDecl *RD) {
   return RD->getName() == "Stmt" && InClangNamespace(RD);
 }
 
+static bool isClangAttr(const RecordDecl *RD) {
+  return RD->getName() == "Attr" && InClangNamespace(RD);
+}
+
 static bool IsStdVector(QualType T) {
   const TemplateSpecializationType *TS = T->getAs<TemplateSpecializationType>();
   if (!TS)
@@ -210,7 +214,7 @@ static bool AllocatesMemory(QualType T) {
 
 // This type checking could be sped up via dynamic programming.
 static bool IsPartOfAST(const CXXRecordDecl *R) {
-  if (IsClangStmt(R) || IsClangType(R) || IsClangDecl(R))
+  if (IsClangStmt(R) || IsClangType(R) || IsClangDecl(R) || isClangAttr(R))
     return true;
 
   for (CXXRecordDecl::base_class_const_iterator I = R->bases_begin(),