[PATCH] D77598: Integral template argument suffix and cast printing

2021-11-14 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added inline comments. Comment at: clang/lib/AST/DeclPrinter.cpp:1101 Out << ", "; -Args[I].print(Policy, Out); +if (TemplOverloaded || !Params) + Args[I].print(Policy, Out, /*IncludeType*/ true); rsmith wrote: > dblaikie wrote: > > d

[PATCH] D77598: Integral template argument suffix and cast printing

2021-11-12 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/AST/DeclPrinter.cpp:1101 Out << ", "; -Args[I].print(Policy, Out); +if (TemplOverloaded || !Params) + Args[I].print(Policy, Out, /*IncludeType*/ true); dblaikie wrote: > dblaikie wrote: > > L

[PATCH] D77598: Integral template argument suffix and cast printing

2021-10-10 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added inline comments. Comment at: clang/lib/AST/DeclPrinter.cpp:1101 Out << ", "; -Args[I].print(Policy, Out); +if (TemplOverloaded || !Params) + Args[I].print(Policy, Out, /*IncludeType*/ true); dblaikie wrote: > Looks like this (&

[PATCH] D77598: Integral template argument suffix and cast printing

2021-10-01 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added inline comments. Comment at: clang/lib/AST/DeclPrinter.cpp:1101 Out << ", "; -Args[I].print(Policy, Out); +if (TemplOverloaded || !Params) + Args[I].print(Policy, Out, /*IncludeType*/ true); Looks like this (& the `TemplOverload

[PATCH] D77598: Integral template argument suffix and cast printing

2021-10-01 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added a comment. In D77598#3035591 , @v.g.vassilev wrote: > In D77598#3035449 , @dblaikie wrote: > >> Came across this while trying to do "simplified template names" - producing >> template names in DWARF

[PATCH] D77598: Integral template argument suffix and cast printing

2021-09-30 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added a comment. In D77598#3035449 , @dblaikie wrote: > Came across this while trying to do "simplified template names" - producing > template names in DWARF without template parameter lists as part of the > textual name, then rebuilding tha

[PATCH] D77598: Integral template argument suffix and cast printing

2021-09-30 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added a comment. Came across this while trying to do "simplified template names" - producing template names in DWARF without template parameter lists as part of the textual name, then rebuilding that name from the structural representation of template parameters in DWARF (DW_TAG_templa

[PATCH] D77598: Integral template argument suffix and cast printing

2021-05-12 Thread Vassil Vassilev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG99d63ccff04b: Add type information to integral template argument if required. (authored by reikdas, committed by v.g.vassilev). Repository: rG LLV

[PATCH] D77598: Integral template argument suffix and cast printing

2021-05-10 Thread Pratyush Das via Phabricator via cfe-commits
reikdas updated this revision to Diff 344161. reikdas added a comment. Fix failing test on windows triple and do some code cleanup. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77598/new/ https://reviews.llvm.org/D77598 Files: clang-tools-extra/clangd/Hover.cpp clang/include/clang

[PATCH] D77598: Integral template argument suffix and cast printing

2021-05-09 Thread Pratyush Das via Phabricator via cfe-commits
reikdas updated this revision to Diff 343909. reikdas added a comment. Herald added subscribers: usaxena95, kadircet. Herald added a project: clang-tools-extra. Fix API usage in clangd and fix bug introduced in patch where printing of manually specified default template argument is omitted. CHA

[PATCH] D77598: Integral template argument suffix and cast printing

2021-05-06 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision. rsmith added a comment. This revision is now accepted and ready to land. Thanks, this looks good to me! Thank you for your patience :) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77598/new/ https://reviews.llvm.org/D77598 __

[PATCH] D77598: Integral template argument suffix and cast printing

2021-05-06 Thread Pratyush Das via Phabricator via cfe-commits
reikdas updated this revision to Diff 343363. reikdas added a comment. Address @rsmith comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77598/new/ https://reviews.llvm.org/D77598 Files: clang/include/clang/AST/DeclTemplate.h clang/include/clang/AST/Expr.h clang/include/clan

[PATCH] D77598: Integral template argument suffix and cast printing

2021-05-05 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. Thanks, I'm broadly very happy with this. My remaining comments are all very minor. Comment at: clang/include/clang/AST/Expr.h:1619 + static void streamChar(unsigned val, CharacterKind Kind, raw_ostream &OS) { +switch (Kind) { Th

[PATCH] D77598: Integral template argument suffix and cast printing

2021-05-05 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment. My concerns are addressed, but I think @rsmith hasn't confirmed that all his concerns are addressed yet. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77598/new/ https://reviews.llvm.org/D77598 ___ cfe-commits mailing li

[PATCH] D77598: Integral template argument suffix and cast printing

2021-05-05 Thread Pratyush Das via Phabricator via cfe-commits
reikdas updated this revision to Diff 342991. reikdas added a comment. Update diff to avoid printing type information if MSVCFormatting printing policy is enabled. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77598/new/ https://reviews.llvm.org/D77598 Files: clang/include/clang/AST

[PATCH] D77598: Integral template argument suffix and cast printing

2021-04-27 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: clang/lib/AST/TemplateBase.cpp:71-72 if (T->isBooleanType() && !Policy.MSVCFormatting) { Out << (Val.getBoolValue() ? "true" : "false"); } else if (T->isCharType()) { reikdas wrote: > rnk wrote: > > rsmith wrote

[PATCH] D77598: Integral template argument suffix and cast printing

2021-04-27 Thread Pratyush Das via Phabricator via cfe-commits
reikdas added a comment. ping... CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77598/new/ https://reviews.llvm.org/D77598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D77598: Integral template argument suffix and cast printing

2021-04-10 Thread Pratyush Das via Phabricator via cfe-commits
reikdas added inline comments. Comment at: clang/lib/AST/TemplateBase.cpp:71-72 if (T->isBooleanType() && !Policy.MSVCFormatting) { Out << (Val.getBoolValue() ? "true" : "false"); } else if (T->isCharType()) { rnk wrote: > rsmith wrote: > > rsmith wr

[PATCH] D77598: Integral template argument suffix and cast printing

2021-04-10 Thread Pratyush Das via Phabricator via cfe-commits
reikdas updated this revision to Diff 336604. reikdas added a comment. Address @rsmith comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77598/new/ https://reviews.llvm.org/D77598 Files: clang/include/clang/AST/DeclTemplate.h clang/include/clang/AST/Expr.h clang/include/cla

[PATCH] D77598: Integral template argument suffix and cast printing

2021-02-22 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: clang/lib/AST/TemplateBase.cpp:71-72 if (T->isBooleanType() && !Policy.MSVCFormatting) { Out << (Val.getBoolValue() ? "true" : "false"); } else if (T->isCharType()) { rsmith wrote: > rsmith wrote: > > rnk wrote:

[PATCH] D77598: Integral template argument suffix and cast printing

2021-02-19 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/AST/TemplateBase.cpp:90 + } else if (T->isWideCharType()) +Out << "L'" << reinterpret_cast(Val.getLimitedValue(WCHAR_MAX)) +<< "'"; `getLimitedValue` doesn't return a pointer, and the host `WCHAR_MA

[PATCH] D77598: Integral template argument suffix and cast printing

2021-02-15 Thread Pratyush Das via Phabricator via cfe-commits
reikdas updated this revision to Diff 323696. reikdas added a comment. Address @rsmith comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77598/new/ https://reviews.llvm.org/D77598 Files: clang/include/clang/AST/DeclTemplate.h clang/include/clang/AST/StmtDataCollectors.td cl

[PATCH] D77598: Integral template argument suffix and cast printing

2021-02-08 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/AST/TemplateBase.cpp:110 +break; + default: +if (T->isUnsignedIntegerType() && T->isWideCharType()) I think we should use the prettier printing for `wchar_t` / `char8_t` / `char16_t` / `cha

[PATCH] D77598: Integral template argument suffix and cast printing

2021-01-06 Thread Pratyush Das via Phabricator via cfe-commits
reikdas updated this revision to Diff 314859. reikdas marked 2 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77598/new/ https://reviews.llvm.org/D77598 Files: clang/include/clang/AST/DeclTemplate.h clang/include/clang/AST/StmtDataCollectors.td clang/include

[PATCH] D77598: Integral template argument suffix and cast printing

2021-01-06 Thread Pratyush Das via Phabricator via cfe-commits
reikdas updated this revision to Diff 314858. reikdas marked an inline comment as done. reikdas added a comment. Address @rsmith review CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77598/new/ https://reviews.llvm.org/D77598 Files: clang/include/clang/AST/DeclTemplate.h clang/inclu

[PATCH] D77598: Integral template argument suffix and cast printing

2021-01-05 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/AST/TemplateBase.cpp:111-115 + Out << "u8'" << Val << "'"; +else if (T->isUnsignedIntegerType() && T->isChar16Type()) + Out << "u16'" << Val << "'"; +else if (T->isUnsignedIntegerType() && T->is

[PATCH] D77598: Integral template argument suffix and cast printing

2020-12-20 Thread Pratyush Das via Phabricator via cfe-commits
reikdas marked 22 inline comments as done. reikdas added inline comments. Comment at: clang/lib/AST/TemplateBase.cpp:111-115 + Out << "u8'" << Val << "'"; +else if (T->isUnsignedIntegerType() && T->isChar16Type()) + Out << "u16'" << Val << "'"; +

[PATCH] D77598: Integral template argument suffix and cast printing

2020-12-20 Thread Pratyush Das via Phabricator via cfe-commits
reikdas updated this revision to Diff 312980. reikdas added a comment. Address @rsmith comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77598/new/ https://reviews.llvm.org/D77598 Files: clang/include/clang/AST/DeclTemplate.h clang/include/clang/AST/StmtDataCollectors.td cl

[PATCH] D77598: Integral template argument suffix and cast printing

2020-12-09 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/include/clang/AST/DeclTemplate.h:213 +else if (Idx >= TPL->size()) + return false; +else { We should return `true` in this case; we don't know what the corresponding parameter is so we don't know if th

[PATCH] D77598: Integral template argument suffix and cast printing

2020-11-25 Thread Pratyush Das via Phabricator via cfe-commits
reikdas marked 25 inline comments as done. reikdas added inline comments. Comment at: clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp:471 + template struct X {}; + X<1, 1u>::type y; // expected-error {{no type named 'type' in 'TypeSuffix::X<1, 1u>'}} + X<1, 1>::type z; //

[PATCH] D77598: Integral template argument suffix and cast printing

2020-11-25 Thread Pratyush Das via Phabricator via cfe-commits
reikdas updated this revision to Diff 307587. reikdas added a comment. Address @rsmith 's comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77598/new/ https://reviews.llvm.org/D77598 Files: clang/include/clang/AST/DeclTemplate.h clang/include/clang/AST/StmtDataCollectors.td

[PATCH] D77598: Integral template argument suffix and cast printing

2020-11-18 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/include/clang/AST/StmtDataCollectors.td:67-75 +if (auto *ParamTypeDecl = dyn_cast(TemplParam)) { + const clang::Type *ParamType = ParamTypeDecl->getTypeForDecl(); + if (auto *autoT = ParamType->

[PATCH] D77598: Integral template argument suffix and cast printing

2020-11-18 Thread Pratyush Das via Phabricator via cfe-commits
reikdas updated this revision to Diff 306097. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77598/new/ https://reviews.llvm.org/D77598 Files: clang/include/clang/AST/StmtDataCollectors.td clang/include/clang/AST/TemplateBase.h clang/lib/AST/ASTContext.cpp clang/lib/AST/ASTTypeTra

[PATCH] D77598: Integral template argument suffix and cast printing

2020-11-18 Thread Pratyush Das via Phabricator via cfe-commits
reikdas updated this revision to Diff 306059. reikdas added a comment. Addresses @rsmith 's comments. > On that basis, I think it would be preferable to change > TemplateArgument::print to accept not a bool indicating whether the type was > known, but instead a const NamedDecl * for the corresp

[PATCH] D77598: Integral template argument suffix and cast printing

2020-11-05 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. Having looked a bit more at the callers here, I think the pattern we're going to want is: - everywhere that prints a template argument list also asks for a list of corresponding template parameters - if the list of template parameters is unknown (perhaps because the temp

[PATCH] D77598: Integral template argument suffix and cast printing

2020-09-29 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: clang/lib/AST/TemplateBase.cpp:71-72 if (T->isBooleanType() && !Policy.MSVCFormatting) { Out << (Val.getBoolValue() ? "true" : "false"); } else if (T->isCharType()) { rsmith wrote: > reikdas wrote: > > rsmith wr

[PATCH] D77598: Integral template argument suffix and cast printing

2020-09-22 Thread Pratyush Das via Phabricator via cfe-commits
reikdas added inline comments. Comment at: clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp:466 + template <> struct S<1> { using type = int; }; // expected-note {{'S<1>::type' declared here}} + S<1L>::type t; // expected-error {{no type named 'type' in 'PR9227::S<1L>'; did

[PATCH] D77598: Integral template argument suffix and cast printing

2020-09-22 Thread Pratyush Das via Phabricator via cfe-commits
reikdas updated this revision to Diff 293432. reikdas added a comment. Attempt an alternate approach, following @rsmith 's inline suggestions. Unfortunately, one of the tests added in this revision unexpectedly fail in this approach :( CHANGES SINCE LAST ACTION https://reviews.llvm.org/D7759

[PATCH] D77598: Integral template argument suffix and cast printing

2020-09-17 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/AST/TemplateBase.cpp:71-72 if (T->isBooleanType() && !Policy.MSVCFormatting) { Out << (Val.getBoolValue() ? "true" : "false"); } else if (T->isCharType()) { reikdas wrote: > rsmith wrote: > > rsmith

[PATCH] D77598: Integral template argument suffix and cast printing

2020-08-14 Thread Pratyush Das via Phabricator via cfe-commits
reikdas updated this revision to Diff 285565. reikdas added a comment. Made some changes to SemaTemplate.cpp based on http://clang-developers.42468.n3.nabble.com/Using-clang-tool-to-Exact-type-names-in-template-specification-arguments-td4069210.html CHANGES SINCE LAST ACTION https://reviews.l

[PATCH] D77598: Integral template argument suffix and cast printing

2020-08-09 Thread Pratyush Das via Phabricator via cfe-commits
reikdas updated this revision to Diff 284186. reikdas added a comment. Can completely replace CanonParamType. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77598/new/ https://reviews.llvm.org/D77598 Files: clang/lib/AST/TemplateBase.cpp clang/lib/Sema/SemaTemplate.cpp clang/test/

[PATCH] D77598: Integral template argument suffix and cast printing

2020-08-09 Thread Pratyush Das via Phabricator via cfe-commits
reikdas added inline comments. Comment at: clang/lib/AST/TemplateBase.cpp:71-72 if (T->isBooleanType() && !Policy.MSVCFormatting) { Out << (Val.getBoolValue() ? "true" : "false"); } else if (T->isCharType()) { rsmith wrote: > rsmith wrote: > > It loo

[PATCH] D77598: Integral template argument suffix and cast printing

2020-08-09 Thread Pratyush Das via Phabricator via cfe-commits
reikdas updated this revision to Diff 284181. reikdas edited the summary of this revision. reikdas added a comment. Addresses inline comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77598/new/ https://reviews.llvm.org/D77598 Files: clang/lib/AST/TemplateBase.cpp clang/lib/Se

[PATCH] D77598: Integral template argument suffix and cast printing

2020-07-05 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added inline comments. Comment at: clang/test/SemaTemplate/matrix-type.cpp:77 void use_matrix_3(matrix &m) {} -// expected-note@-1 {{candidate template ignored: deduced type 'matrix<[...], 5UL - 2, 5UL>' of 1st parameter does not match adjusted type 'matrix<[...], 5

[PATCH] D77598: Integral template argument suffix and cast printing

2020-07-05 Thread Pratyush Das via Phabricator via cfe-commits
reikdas added a comment. In D77598#2111606 , @rsmith wrote: > In D77598#2064193 , @rsmith wrote: > > > In D77598#1990197 , @rsmith wrote: > > > > > Is is feasible to check wh

[PATCH] D77598: Integral template argument suffix and cast printing

2020-06-24 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In D77598#2064193 , @rsmith wrote: > In D77598#1990197 , @rsmith wrote: > > > Is is feasible to check whether the corresponding template parameter either > > has a deduced type or is a param

[PATCH] D77598: Integral template argument suffix and cast printing

2020-06-04 Thread Pratyush Das via Phabricator via cfe-commits
reikdas updated this revision to Diff 268412. reikdas marked an inline comment as done. reikdas retitled this revision from "Integral template argument suffix printing" to "Integral template argument suffix and cast printing". reikdas edited the summary of this revision. reikdas added a comment.