summaryrefslogtreecommitdiffstats
path: root/docs/LibASTMatchersReference.html
diff options
context:
space:
mode:
authorClement Courbet <courbet@google.com>2018-11-22 14:00:56 +0000
committerClement Courbet <courbet@google.com>2018-11-22 14:00:56 +0000
commitea98fe0936a1b9046fcd47a6ad37a7e757acea0d (patch)
tree4d8d83146f01c7df289038cbe250c77faea872ab /docs/LibASTMatchersReference.html
parent922444780d20fc992120f80e0ec7c435f4b311a4 (diff)
[ASTMatchers] Add hasSideEffect() matcher.
Summary: Exposes Expr::HasSideEffects. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D54830 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347462 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/LibASTMatchersReference.html')
-rw-r--r--docs/LibASTMatchersReference.html18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/LibASTMatchersReference.html b/docs/LibASTMatchersReference.html
index b547f7ece6..ce651c282e 100644
--- a/docs/LibASTMatchersReference.html
+++ b/docs/LibASTMatchersReference.html
@@ -2817,6 +2817,24 @@ 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.