From: Aaron Ballman Date: Wed, 18 Nov 2015 17:16:01 +0000 (+0000) Subject: Reverting r253473 while I investigate build bot failures. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f5ba67702817476016e69986bbcd49899e5ffe80;p=clang Reverting r253473 while I investigate build bot failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253475 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/LibASTMatchersReference.html b/docs/LibASTMatchersReference.html index 8b757f1276..1f681e7f9a 100644 --- a/docs/LibASTMatchersReference.html +++ b/docs/LibASTMatchersReference.html @@ -1774,21 +1774,6 @@ cxxMethodDecl(isConst()) matches A::foo() but not A::bar() -Matcher<CXXMethodDecl>isCopyAssignmentOperator -
Matches if the given method declaration declares a copy assignment
-operator.
-
-Given
-struct A {
-  A &operator=(const A &);
-  A &operator=(A &&);
-};
-
-cxxMethodDecl(isCopyAssignmentOperator()) matches the first method but not
-the second one.
-
- - Matcher<CXXMethodDecl>isFinal
Matches if the given method or class declaration is final.
 
@@ -2764,20 +2749,6 @@ Example matches a || b (matcher = binaryOperator(hasOperatorName("||")))
 
-Matcher<VarDecl>hasAutomaticStorageDuration -
Matches a variable declaration that has automatic storage duration.
-
-Example matches x, but not y, z, or a.
-(matcher = varDecl(hasAutomaticStorageDuration())
-void f() {
-  int x;
-  static int y;
-  thread_local int z;
-}
-int a;
-
- - Matcher<VarDecl>hasGlobalStorage
Matches a variable declaration that does not have local storage.
 
@@ -2803,34 +2774,6 @@ int z;
 
-Matcher<VarDecl>hasStaticStorageDuration -
Matches a variable declaration that has static storage duration.
-
-Example matches y and a, but not x or z.
-(matcher = varDecl(hasStaticStorageDuration())
-void f() {
-  int x;
-  static int y;
-  thread_local int z;
-}
-int a;
-
- - -Matcher<VarDecl>hasThreadStorageDuration -
Matches a variable declaration that has thread storage duration.
-
-Example matches z, but not x, z, or a.
-(matcher = varDecl(hasThreadStorageDuration())
-void f() {
-  int x;
-  static int y;
-  thread_local int z;
-}
-int a;
-
- - Matcher<VarDecl>isConstexpr
Matches constexpr variable and function declarations.
 
@@ -3097,22 +3040,6 @@ arraySubscriptExpression(hasIndex(integerLiteral()))
 
-Matcher<ArraySubscriptExpr>hasLHSMatcher<Expr> InnerMatcher -
Matches the left hand side of binary operator expressions.
-
-Example matches a (matcher = binaryOperator(hasLHS()))
-  a || b
-
- - -Matcher<ArraySubscriptExpr>hasRHSMatcher<Expr> InnerMatcher -
Matches the right hand side of binary operator expressions.
-
-Example matches b (matcher = binaryOperator(hasRHS()))
-  a || b
-
- - Matcher<ArrayTypeLoc>hasElementTypeLocMatcher<TypeLoc>
Matches arrays and C99 complex types that have a specific element
 type.
diff --git a/include/clang/ASTMatchers/ASTMatchers.h b/include/clang/ASTMatchers/ASTMatchers.h
index e640f511f1..8147de426e 100644
--- a/include/clang/ASTMatchers/ASTMatchers.h
+++ b/include/clang/ASTMatchers/ASTMatchers.h
@@ -2544,54 +2544,6 @@ AST_MATCHER(VarDecl, hasGlobalStorage) {
   return Node.hasGlobalStorage();
 }
 
-/// \brief Matches a variable declaration that has automatic storage duration.
-///
-/// Example matches x, but not y, z, or a.
-/// (matcher = varDecl(hasAutomaticStorageDuration())
-/// \code
-/// void f() {
-///   int x;
-///   static int y;
-///   thread_local int z;
-/// }
-/// int a;
-/// \endcode
-AST_MATCHER(VarDecl, hasAutomaticStorageDuration) {
-  return Node.getStorageDuration() == SD_Automatic;
-}
-
-/// \brief Matches a variable declaration that has static storage duration.
-///
-/// Example matches y and a, but not x or z.
-/// (matcher = varDecl(hasStaticStorageDuration())
-/// \code
-/// void f() {
-///   int x;
-///   static int y;
-///   thread_local int z;
-/// }
-/// int a;
-/// \endcode
-AST_MATCHER(VarDecl, hasStaticStorageDuration) {
-  return Node.getStorageDuration() == SD_Static;
-}
-
-/// \brief Matches a variable declaration that has thread storage duration.
-///
-/// Example matches z, but not x, z, or a.
-/// (matcher = varDecl(hasThreadStorageDuration())
-/// \code
-/// void f() {
-///   int x;
-///   static int y;
-///   thread_local int z;
-/// }
-/// int a;
-/// \endcode
-AST_MATCHER(VarDecl, hasThreadStorageDuration) {
-  return Node.getStorageDuration() == SD_Thread;
-}
-
 /// \brief Matches a variable declaration that is an exception variable from
 /// a C++ catch block, or an Objective-C \@catch statement.
 ///
diff --git a/lib/ASTMatchers/Dynamic/Registry.cpp b/lib/ASTMatchers/Dynamic/Registry.cpp
index ff79244f9a..eb41de1b6a 100644
--- a/lib/ASTMatchers/Dynamic/Registry.cpp
+++ b/lib/ASTMatchers/Dynamic/Registry.cpp
@@ -194,7 +194,6 @@ RegistryMaps::RegistryMaps() {
   REGISTER_MATCHER(hasArgument);
   REGISTER_MATCHER(hasArgumentOfType);
   REGISTER_MATCHER(hasAttr);
-  REGISTER_MATCHER(hasAutomaticStorageDuration);
   REGISTER_MATCHER(hasBase);
   REGISTER_MATCHER(hasBody);
   REGISTER_MATCHER(hasCanonicalType);
@@ -239,11 +238,9 @@ RegistryMaps::RegistryMaps() {
   REGISTER_MATCHER(hasSize);
   REGISTER_MATCHER(hasSizeExpr);
   REGISTER_MATCHER(hasSourceExpression);
-  REGISTER_MATCHER(hasThreadStorageDuration);
   REGISTER_MATCHER(hasTargetDecl);
   REGISTER_MATCHER(hasTemplateArgument);
   REGISTER_MATCHER(hasThen);
-  REGISTER_MATCHER(hasThreadStorageDuration);
   REGISTER_MATCHER(hasTrueExpression);
   REGISTER_MATCHER(hasTypeLoc);
   REGISTER_MATCHER(hasUnaryOperand);
diff --git a/unittests/ASTMatchers/ASTMatchersTest.cpp b/unittests/ASTMatchers/ASTMatchersTest.cpp
index 6d81bd88b9..476a0be290 100644
--- a/unittests/ASTMatchers/ASTMatchersTest.cpp
+++ b/unittests/ASTMatchers/ASTMatchersTest.cpp
@@ -1355,29 +1355,6 @@ TEST(Matcher, VarDecl_Storage) {
   EXPECT_TRUE(matches("void f() { static int X; }", M));
 }
 
-TEST(Matcher, VarDecl_StorageDuration) {
-  std::string T =
-      "void f() { int x; static int y; thread_local int z; } int a;";
-
-  EXPECT_TRUE(matches(T, varDecl(hasName("x"), hasAutomaticStorageDuration())));
-  EXPECT_TRUE(
-      notMatches(T, varDecl(hasName("y"), hasAutomaticStorageDuration())));
-  EXPECT_TRUE(
-      notMatches(T, varDecl(hasName("z"), hasAutomaticStorageDuration())));
-  EXPECT_TRUE(
-      notMatches(T, varDecl(hasName("a"), hasAutomaticStorageDuration())));
-
-  EXPECT_TRUE(matches(T, varDecl(hasName("y"), hasStaticStorageDuration())));
-  EXPECT_TRUE(matches(T, varDecl(hasName("a"), hasStaticStorageDuration())));
-  EXPECT_TRUE(notMatches(T, varDecl(hasName("x"), hasStaticStorageDuration())));
-  EXPECT_TRUE(notMatches(T, varDecl(hasName("z"), hasStaticStorageDuration())));
-
-  EXPECT_TRUE(matches(T, varDecl(hasName("z"), hasThreadStorageDuration())));
-  EXPECT_TRUE(notMatches(T, varDecl(hasName("x"), hasThreadStorageDuration())));
-  EXPECT_TRUE(notMatches(T, varDecl(hasName("y"), hasThreadStorageDuration())));
-  EXPECT_TRUE(notMatches(T, varDecl(hasName("a"), hasThreadStorageDuration())));
-}
-
 TEST(Matcher, FindsVarDeclInFunctionParameter) {
   EXPECT_TRUE(matches(
       "void f(int i) {}",