Rename AST node matchers to match the AST node names directly. Part of this rename also splits recordDecl() (which used to match CXXRecordDecl) into recordDecl() (that matches RecordDecl) and cxxRecordDecl (that matches CXXRecordDecl). Also adds isStruct(), isUnion(), and isClass() narrowing matchers for RecordDecl objects.

llvm-svn: 247885
diff --git a/clang/unittests/AST/DeclPrinterTest.cpp b/clang/unittests/AST/DeclPrinterTest.cpp
index d8cb977..d06fbfe 100644
--- a/clang/unittests/AST/DeclPrinterTest.cpp
+++ b/clang/unittests/AST/DeclPrinterTest.cpp
@@ -471,7 +471,7 @@
     "struct A {"
     "  A();"
     "};",
-    constructorDecl(ofClass(hasName("A"))).bind("id"),
+    cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
     "A()"));
 }
 
@@ -480,7 +480,7 @@
     "struct A {"
     "  A(int a);"
     "};",
-    constructorDecl(ofClass(hasName("A"))).bind("id"),
+    cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
     "A(int a)"));
 }
 
@@ -489,7 +489,7 @@
     "struct A {"
     "  A(const A &a);"
     "};",
-    constructorDecl(ofClass(hasName("A"))).bind("id"),
+    cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
     "A(const A &a)"));
 }
 
@@ -498,7 +498,7 @@
     "struct A {"
     "  A(const A &a, int = 0);"
     "};",
-    constructorDecl(ofClass(hasName("A"))).bind("id"),
+    cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
     "A(const A &a, int = 0)"));
 }
 
@@ -507,7 +507,7 @@
     "struct A {"
     "  A(const A &&a);"
     "};",
-    constructorDecl(ofClass(hasName("A"))).bind("id"),
+    cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
     "A(const A &&a)"));
 }
 
@@ -516,7 +516,7 @@
     "struct A {"
     "  explicit A(int a);"
     "};",
-    constructorDecl(ofClass(hasName("A"))).bind("id"),
+    cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
     "explicit A(int a)"));
 }
 
@@ -525,7 +525,7 @@
     "struct A {"
     "  constexpr A();"
     "};",
-    constructorDecl(ofClass(hasName("A"))).bind("id"),
+    cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
     "constexpr A()"));
 }
 
@@ -534,7 +534,7 @@
     "struct A {"
     "  A() = default;"
     "};",
-    constructorDecl(ofClass(hasName("A"))).bind("id"),
+    cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
     "A() = default"));
 }
 
@@ -543,7 +543,7 @@
     "struct A {"
     "  A() = delete;"
     "};",
-    constructorDecl(ofClass(hasName("A"))).bind("id"),
+    cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
     "A() = delete"));
 }
 
@@ -553,7 +553,7 @@
     "struct A {"
     "  A(const A &a);"
     "};",
-    constructorDecl(ofClass(hasName("A"))).bind("id"),
+    cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
     "A<T...>(const A<T...> &a)"));
     // WRONG; Should be: "A(const A<T...> &a);"
 }
@@ -564,7 +564,7 @@
     "struct A : public T... {"
     "  A(T&&... ts) : T(ts)... {}"
     "};",
-    constructorDecl(ofClass(hasName("A"))).bind("id"),
+    cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
     "A<T...>(T &&...ts) : T(ts)..."));
     // WRONG; Should be: "A(T &&...ts) : T(ts)... {}"
 }
@@ -574,7 +574,7 @@
     "struct A {"
     "  ~A();"
     "};",
-    destructorDecl(ofClass(hasName("A"))).bind("id"),
+    cxxDestructorDecl(ofClass(hasName("A"))).bind("id"),
     "~A()"));
 }
 
@@ -583,7 +583,7 @@
     "struct A {"
     "  virtual ~A();"
     "};",
-    destructorDecl(ofClass(hasName("A"))).bind("id"),
+    cxxDestructorDecl(ofClass(hasName("A"))).bind("id"),
     "virtual ~A()"));
 }
 
@@ -592,7 +592,7 @@
     "struct A {"
     "  operator int();"
     "};",
-    methodDecl(ofClass(hasName("A"))).bind("id"),
+    cxxMethodDecl(ofClass(hasName("A"))).bind("id"),
     "operator int()"));
 }
 
@@ -601,7 +601,7 @@
     "struct A {"
     "  operator bool();"
     "};",
-    methodDecl(ofClass(hasName("A"))).bind("id"),
+    cxxMethodDecl(ofClass(hasName("A"))).bind("id"),
     "operator bool()"));
 }
 
@@ -611,7 +611,7 @@
     "struct A {"
     "  operator Z();"
     "};",
-    methodDecl(ofClass(hasName("A"))).bind("id"),
+    cxxMethodDecl(ofClass(hasName("A"))).bind("id"),
     "operator Z()"));
 }
 
@@ -621,7 +621,7 @@
     "struct Z {"
     "  void *operator new(std::size_t);"
     "};",
-    methodDecl(ofClass(hasName("Z"))).bind("id"),
+    cxxMethodDecl(ofClass(hasName("Z"))).bind("id"),
     "void *operator new(std::size_t)"));
     // Should be: with semicolon
 }
@@ -632,7 +632,7 @@
     "struct Z {"
     "  void *operator new[](std::size_t);"
     "};",
-    methodDecl(ofClass(hasName("Z"))).bind("id"),
+    cxxMethodDecl(ofClass(hasName("Z"))).bind("id"),
     "void *operator new[](std::size_t)"));
     // Should be: with semicolon
 }
@@ -642,7 +642,7 @@
     "struct Z {"
     "  void operator delete(void *);"
     "};",
-    methodDecl(ofClass(hasName("Z"))).bind("id"),
+    cxxMethodDecl(ofClass(hasName("Z"))).bind("id"),
     "void operator delete(void *) noexcept"));
     // Should be: with semicolon, without noexcept?
 }
@@ -652,7 +652,7 @@
     "struct Z {"
     "  void operator delete(void *);"
     "};",
-    methodDecl(ofClass(hasName("Z"))).bind("id"),
+    cxxMethodDecl(ofClass(hasName("Z"))).bind("id"),
     "void operator delete(void *)"));
     // Should be: with semicolon
 }
@@ -662,7 +662,7 @@
     "struct Z {"
     "  void operator delete[](void *);"
     "};",
-    methodDecl(ofClass(hasName("Z"))).bind("id"),
+    cxxMethodDecl(ofClass(hasName("Z"))).bind("id"),
     "void operator delete[](void *) noexcept"));
     // Should be: with semicolon, without noexcept?
 }
@@ -690,7 +690,7 @@
 
     ASSERT_TRUE(PrintedDeclCXX98Matches(
       Code,
-      methodDecl(ofClass(hasName("Z"))).bind("id"),
+      cxxMethodDecl(ofClass(hasName("Z"))).bind("id"),
       Expected));
   }
 }
@@ -714,7 +714,7 @@
 
     ASSERT_TRUE(PrintedDeclCXX98Matches(
       Code,
-      methodDecl(ofClass(hasName("Z"))).bind("id"),
+      cxxMethodDecl(ofClass(hasName("Z"))).bind("id"),
       Expected));
   }
 }