Revert rL347462 "[ASTMatchers] Add hasSideEffect() matcher."

Breaks some buildbots.

llvm-svn: 347463
This commit is contained in:
Clement Courbet 2018-11-22 14:26:33 +00:00
parent c022c51f89
commit a6144db15f
4 changed files with 0 additions and 55 deletions

View File

@ -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.

View File

@ -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

View File

@ -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);

View File

@ -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