summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClement Courbet <courbet@google.com>2018-11-22 14:26:33 +0000
committerClement Courbet <courbet@google.com>2018-11-22 14:26:33 +0000
commita6144db15fdfdd6a0895cec0d915a7d6f3edb697 (patch)
tree3fbca595e4caff6564a69801a62764bc7939035f
parentc022c51f89cd6bc5df9d06ea3e4dacf225429347 (diff)
downloadbcm5719-llvm-a6144db15fdfdd6a0895cec0d915a7d6f3edb697.tar.gz
bcm5719-llvm-a6144db15fdfdd6a0895cec0d915a7d6f3edb697.zip
Revert rL347462 "[ASTMatchers] Add hasSideEffect() matcher."
Breaks some buildbots. llvm-svn: 347463
-rw-r--r--clang/docs/LibASTMatchersReference.html18
-rw-r--r--clang/include/clang/ASTMatchers/ASTMatchers.h20
-rw-r--r--clang/lib/ASTMatchers/Dynamic/Registry.cpp1
-rw-r--r--clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp16
4 files changed, 0 insertions, 55 deletions
diff --git a/clang/docs/LibASTMatchersReference.html b/clang/docs/LibASTMatchersReference.html
index ce651c282eb..b547f7ece62 100644
--- a/clang/docs/LibASTMatchersReference.html
+++ b/clang/docs/LibASTMatchersReference.html
@@ -2817,24 +2817,6 @@ enum class Y {};
</pre></td></tr>
-<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>&gt;</td><td class="name" onclick="toggle('hasSideEffects0')"><a name="hasSideEffects0Anchor">hasSideEffects</a></td><td></td></tr>
-<tr><td colspan="4" class="doc" id="hasSideEffects0"><pre>Matches expressions with potential side effects other than producing
-a value, such as a calling a function, throwing an exception, or reading a
-volatile variable.
-
-Given
- void f(int&amp; a, int b, volatile int c) {
- call();
- a = 0;
- a;
- b;
- c;
- }
-expr(hasSideEffects())
- matches 'call()', 'a = 0', 'c', but not '0', 'a', 'b'.
-</pre></td></tr>
-
-
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>&gt;</td><td class="name" onclick="toggle('isInstantiationDependent0')"><a name="isInstantiationDependent0Anchor">isInstantiationDependent</a></td><td></td></tr>
<tr><td colspan="4" class="doc" id="isInstantiationDependent0"><pre>Matches expressions that are instantiation-dependent even if it is
neither type- nor value-dependent.
diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h b/clang/include/clang/ASTMatchers/ASTMatchers.h
index 73ae8fb244a..f42ac5b701b 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchers.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -4118,26 +4118,6 @@ AST_MATCHER_P(IfStmt, hasConditionVariableStatement,
InnerMatcher.matches(*DeclarationStatement, Finder, Builder);
}
-/// \brief Matches expressions with potential side effects other than producing
-/// a value, such as a calling a function, throwing an exception, or reading a
-/// volatile variable.
-///
-/// Given
-/// \code
-/// void f(int& a, int b, volatile int c) {
-/// call();
-/// a = 0;
-/// a;
-/// b;
-/// c;
-/// }
-/// \endcode
-/// expr(hasSideEffects())
-/// matches 'call()', 'a = 0', 'c', but not '0', 'a', 'b'.
-AST_MATCHER(Expr, hasSideEffects) {
- return Node.HasSideEffects(Finder->getASTContext());
-}
-
/// Matches the index expression of an array subscript expression.
///
/// Given
diff --git a/clang/lib/ASTMatchers/Dynamic/Registry.cpp b/clang/lib/ASTMatchers/Dynamic/Registry.cpp
index fb9e110d30a..3ed189a524c 100644
--- a/clang/lib/ASTMatchers/Dynamic/Registry.cpp
+++ b/clang/lib/ASTMatchers/Dynamic/Registry.cpp
@@ -294,7 +294,6 @@ RegistryMaps::RegistryMaps() {
REGISTER_MATCHER(hasReturnValue);
REGISTER_MATCHER(hasRHS);
REGISTER_MATCHER(hasSelector);
- REGISTER_MATCHER(hasSideEffects);
REGISTER_MATCHER(hasSingleDecl);
REGISTER_MATCHER(hasSize);
REGISTER_MATCHER(hasSizeExpr);
diff --git a/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
index 076d21a1f5e..e37bcbeec1f 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
@@ -2259,21 +2259,5 @@ TEST(Matcher, isMain) {
notMatches("int main2() {}", functionDecl(isMain())));
}
-TEST(Matcher, hasSideEffects) {
- EXPECT_TRUE(matches("void call();"
- "void f() { call(); }",
- expr(hasSideEffects())));
- EXPECT_TRUE(matches("void f(int& a) { a = 0; }", expr(hasSideEffects())));
- EXPECT_TRUE(
- matches("void f(volatile int a) { (void)a; }", expr(hasSideEffects())));
-
- EXPECT_TRUE(notMatches("void call();"
- "void f() { }",
- expr(hasSideEffects())));
- EXPECT_TRUE(
- notMatches("void f(int& a) { (void)a; }", expr(hasSideEffects())));
- EXPECT_TRUE(notMatches("void f(int a) { (void)a; }", expr(hasSideEffects())));
-}
-
} // namespace ast_matchers
} // namespace clang
OpenPOWER on IntegriCloud