[PATCH] D59639: [clangd] Print template arguments helper

2019-04-14 Thread Nico Weber via Phabricator via cfe-commits
thakis added inline comments. Comment at: clang-tools-extra/trunk/unittests/clangd/CMakeLists.txt:16 Annotations.cpp + PrintASTTests.cpp BackgroundIndexTests.cpp Keep alphabetized? Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D59639: [clangd] Print template arguments helper

2019-04-12 Thread Kadir Cetinkaya via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL358272: [clangd] Print template arguments helper (authored by kadircet, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.ll

[PATCH] D59639: [clangd] Print template arguments helper

2019-04-11 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/AST.cpp:139 + // location information. + printTemplateArgumentList(OS, Cls->getTemplateArgs().asArray(), Policy); +} ioeric wrote: > Could you also add a test case for this with th

[PATCH] D59639: [clangd] Print template arguments helper

2019-04-11 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 194686. kadircet marked 6 inline comments as done. kadircet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59639/new/ https://reviews.llvm.org/D59639 Files: clang-tools-ex

[PATCH] D59639: [clangd] Print template arguments helper

2019-04-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. lgtm Comment at: clang-tools-extra/clangd/AST.cpp:139 + // location information. + printTemplateArgumentList(OS, Cls->getTemplateArgs().asArray(), Policy); +} -

[PATCH] D59639: [clangd] Print template arguments helper

2019-04-11 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 194658. kadircet added a comment. - Update file comment for PrintASTTests.cpp Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59639/new/ https://reviews.llvm.org/D59639 Files: clang-tools-extra/clangd/AST.cpp

[PATCH] D59639: [clangd] Print template arguments helper

2019-04-11 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/AST.cpp:133 +printTemplateArgumentList(OS, *Args, Policy); + else if (auto *Cls = llvm::dyn_cast(&ND)) { +if (const TypeSourceInfo *TSI = Cls->getTypeAsWritten()) { ioeric wrote: > kadi

[PATCH] D59639: [clangd] Print template arguments helper

2019-04-11 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 194657. kadircet marked 7 inline comments as done. kadircet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59639/new/ https://reviews.llvm.org/D59639 Files: clang-tools-ex

[PATCH] D59639: [clangd] Print template arguments helper

2019-03-22 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-tools-extra/clangd/AST.cpp:149 +} else { + // FIXME: Fix cases when getTypeAsWritten returns null, e.g. friend decls. + printTemplateArgumentList(OS, Cls->getTemplateArgs().asArray(), Policy); I'm not

[PATCH] D59639: [clangd] Print template arguments helper

2019-03-22 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clangd/AST.cpp:26 +llvm::Optional> +getTemplateSpecializationArgLocs(const NamedDecl &ND) { + if (auto *Func = llvm::dyn_cast(&ND)) { ilya-biryukov wrote: > Eugene.Zelenko wrote: > > Functions s

[PATCH] D59639: [clangd] Print template arguments helper

2019-03-22 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 191857. kadircet marked an inline comment as done. kadircet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59639/new/ https://reviews.llvm.org/D59639 Files: clang-tools-ex

[PATCH] D59639: [clangd] Print template arguments helper

2019-03-22 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet marked 15 inline comments as done. kadircet added inline comments. Comment at: clang-tools-extra/clangd/AST.cpp:88 static const TemplateArgumentList * getTemplateSpecializationArgs(const NamedDecl &ND) { if (auto *Func = llvm::dyn_cast(&ND)) ioeric

[PATCH] D59639: [clangd] Print template arguments helper

2019-03-22 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang-tools-extra/clangd/AST.cpp:26 +llvm::Optional> +getTemplateSpecializationArgLocs(const NamedDecl &ND) { + if (auto *Func = llvm::dyn_cast(&ND)) { Eugene.Zelenko wrote: > Functions should be static, not in an

[PATCH] D59639: [clangd] Print template arguments helper

2019-03-22 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang-tools-extra/unittests/clangd/ASTUtilsTests.cpp:1 +#include "AST.h" +#include "Annotations.h" NIT: add a licence header Comment at: clang-tools-extra/unittests/clangd/CMakeLists.txt:13 An

[PATCH] D59639: [clangd] Print template arguments helper

2019-03-21 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang/lib/AST/TypePrinter.cpp:1640 + +static void printArgument(const TemplateArgumentLoc &A, + const PrintingPolicy &PP, llvm::raw_ostream &OS) { It's unclear to me what the new behavior is with

[PATCH] D59639: [clangd] Print template arguments helper

2019-03-21 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-tools-extra/clangd/AST.cpp:88 static const TemplateArgumentList * getTemplateSpecializationArgs(const NamedDecl &ND) { if (auto *Func = llvm::dyn_cast(&ND)) can we unify this with `getTemplateSpecializationArgL

[PATCH] D59639: [clangd] Print template arguments helper

2019-03-21 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clangd/AST.cpp:26 +llvm::Optional> +getTemplateSpecializationArgLocs(const NamedDecl &ND) { + if (auto *Func = llvm::dyn_cast(&ND)) { Functions should be static, not in anonymous namespace. See

[PATCH] D59639: [clangd] Print template arguments helper

2019-03-21 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added reviewers: ioeric, ilya-biryukov. Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay, mgorny. Herald added a project: clang. Prepares ground for printing template arguments as written in the source code, part of re-landing rC356541