summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2018-12-12 21:50:55 +0000
committerEric Fiselier <eric@efcs.ca>2018-12-12 21:50:55 +0000
commitf89e5ce8508a67f732e550b8313fa7d2f889ee3f (patch)
tree48b0454b27727986397a0928e677f623fe9ebd26 /docs
parent58419897ad2cb6c4a572a0a03705a462e3b07a08 (diff)
[AST] Store "UsesADL" information in CallExpr.
Summary: Currently the Clang AST doesn't store information about how the callee of a CallExpr was found. Specifically if it was found using ADL. However, this information is invaluable to tooling. Consider a tool which renames usages of a function. If the originally CallExpr was formed using ADL, then the tooling may need to additionally qualify the replacement. Without information about how the callee was found, the tooling is left scratching it's head. Additionally, we want to be able to match ADL calls as quickly as possible, which means avoiding computing the answer on the fly. This patch changes `CallExpr` to store whether it's callee was found using ADL. It does not change the size of any AST nodes. Reviewers: fowles, rsmith, klimek, shafik Reviewed By: rsmith Subscribers: aaron.ballman, riccibruno, calabrese, titus, cfe-commits Differential Revision: https://reviews.llvm.org/D55534 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348977 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/LibASTMatchersReference.html22
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/LibASTMatchersReference.html b/docs/LibASTMatchersReference.html
index b5e6199c31..0a8a5a95fa 100644
--- a/docs/LibASTMatchersReference.html
+++ b/docs/LibASTMatchersReference.html
@@ -2562,6 +2562,28 @@ Example matches f(0, 0) (matcher = callExpr(argumentCountIs(2)))
</pre></td></tr>
+<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>&gt;</td><td class="name" onclick="toggle('usesADL0')"><a name="usesADL0Anchor">usesADL</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="usesADL0"><pre>Matches call expressions which were resolved using ADL.
+
+Example matches y(x) but not y(42) or NS::y(x).
+ namespace NS {
+ struct X {};
+ void y(X);
+ }
+
+ void y(...);
+
+ void test() {
+ NS::X x;
+ y(x); // Matches
+ NS::y(x); // Doesn't match
+ y(42); // Doesn't match
+ using NS::y;
+ y(x); // Found by both unqualified lookup and ADL, doesn't match
+ }
+</pre></td></tr>
+
+
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1CastExpr.html">CastExpr</a>&gt;</td><td class="name" onclick="toggle('hasCastKind0')"><a name="hasCastKind0Anchor">hasCastKind</a></td><td>CastKind Kind</td></tr>
<tr><td colspan="4" class="doc" id="hasCastKind0"><pre>Matches casts that has a given cast kind.