From c022c51f89cd6bc5df9d06ea3e4dacf225429347 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Thu, 22 Nov 2018 14:00:56 +0000 Subject: [ASTMatchers] Add hasSideEffect() matcher. Summary: Exposes Expr::HasSideEffects. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D54830 llvm-svn: 347462 --- clang/docs/LibASTMatchersReference.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'clang/docs') diff --git a/clang/docs/LibASTMatchersReference.html b/clang/docs/LibASTMatchersReference.html index b547f7ece62d..ce651c282eb7 100644 --- a/clang/docs/LibASTMatchersReference.html +++ b/clang/docs/LibASTMatchersReference.html @@ -2817,6 +2817,24 @@ enum class Y {}; +Matcher<Expr>hasSideEffects +
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& a, int b, volatile int c) {
+    call();
+    a = 0;
+    a;
+    b;
+    c;
+  }
+expr(hasSideEffects())
+  matches 'call()', 'a = 0', 'c', but not '0', 'a', 'b'.
+
+ + Matcher<Expr>isInstantiationDependent
Matches expressions that are instantiation-dependent even if it is
 neither type- nor value-dependent.
-- 
cgit v1.2.3