[PATCH] D55534: [AST] Store "UsesADL" information in CallExpr.
Eric Fiselier via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 10 22:49:52 PST 2018
EricWF marked 14 inline comments as done.
EricWF added a comment.
Address review comments. Fixes incoming.
================
Comment at: include/clang/AST/ExprCXX.h:218
+ SourceLocation RP, unsigned MinNumArgs = 0,
+ bool UsesADL = false)
: CallExpr(C, CUDAKernelCallExprClass, fn, Config, args, t, VK, RP,
----------------
fowles wrote:
> Can CUDAKernelCalls ever use ADL?
Yeah, after further investigation, I don't think so. I'll revert this change.
================
Comment at: include/clang/AST/ExprCXX.h:499
+ : CallExpr(C, UserDefinedLiteralClass, Fn, Args, T, VK, LitEndLoc,
+ /*MinNumArgs=*/0, /*UsesADL=*/false),
UDSuffixLoc(SuffixLoc) {}
----------------
fowles wrote:
> Same question, I assume user defined literals can only be called as string suffixes and thus never get ADL
Right. Their argument is a literal of some sort.
================
Comment at: lib/Sema/SemaOverload.cpp:8946
+ ExplicitTemplateArgs, Args, CandidateSet,
+ /*SuppressUserConversions=*/false,
+ PartialOverloading, /*IsADLCandidate=*/true);
----------------
fowles wrote:
> should this fix be in a separate change?
I'll commit the fix as a separate patch.
================
Comment at: lib/Serialization/ASTReaderStmt.cpp:735
unsigned NumArgs = Record.readInt();
+ bool UsesADL = Record.readInt();
assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!");
----------------
fowles wrote:
> readInt into a bool?
Yeah. You serialize and serialize all integer types using `readInt()`
================
Comment at: unittests/ASTMatchers/ASTMatchersNodeTest.cpp:204
+ StatementMatcher ADLMatch = callExpr(usesADL());
+ auto NS_Str = R"DELIM(
+ namespace NS {
----------------
fowles wrote:
> if you use cc or cpp as your delimiter, I think clang-format will recurse correctly
That's super cool. Thanks!
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55534/new/
https://reviews.llvm.org/D55534
More information about the cfe-commits
mailing list