[PATCH] D89790: [clangd] Add basic conflict detection for the rename.

2020-10-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: usaxena95, kadircet, arphaman. Herald added a project: clang. hokein requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. With this patch, we reject the rename if the new

[PATCH] D89783: [format] foo..h should be the main-header for foo..cc

2020-10-20 Thread Haojian Wu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. hokein marked an inline comment as done. Closed by commit rG84048e234f8f: [format] foo.name.h should be the main-header for foo.name.cc (authored by hokein).

[PATCH] D89783: [format] foo..h should be the main-header for foo..cc

2020-10-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 299332. hokein added a comment. address comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89783/new/ https://reviews.llvm.org/D89783 Files: clang/include/clang/Tooling/Inclusions/HeaderIncludes.h

[PATCH] D89743: Support Attr in DynTypedNode and ASTMatchers.

2020-10-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Looks like there are some failing tests in premerge bots, e.g. https://reviews.llvm.org/harbormaster/unit/view/185822/ Also run `clang/docs/tools/dump_ast_matchers.py` script to update the `LibASTMatchersReference.html` file. Repository: rG LLVM Github Monorepo

[PATCH] D89783: [format] foo..h should be the main-header for foo..cc

2020-10-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: adamcz. Herald added a project: clang. hokein requested review of this revision. This fixes a regression introduced in https://reviews.llvm.org/D88640. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D89783 Files:

[PATCH] D88640: [Format] Don't treat compound extension headers (foo.proto.h) as foo.cc main file.

2020-10-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D88640#2339349 , @rupprecht wrote: > It looks like this fix caused a different regression in not accepting > `name..h` as the main header for `name..cc`, e.g.: > > $ cat /tmp/foo.bar.cc > #include "a.h" > #include "z.h" >

[PATCH] D89300: [clang-rename] Fix rename on variable templates.

2020-10-19 Thread Haojian Wu 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 rG1e32df2f91f1: [clang-rename] Fix rename on variable templates. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D89221: [clang-rename] Fix rename on function template specializations.

2020-10-19 Thread Haojian Wu 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 rG45a15dc682c0: [clang-rename] Fix rename on function template specializations. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D89220: [clang-rename] Simplify the code of handling class paritial specializations, NFC.

2020-10-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/lib/Tooling/Refactoring/Rename/USRFindingAction.cpp:119 +llvm::for_each(PartialSpecs, + [&](const auto *Spec) { addUSRsOfCtorDtors(Spec); }); addUSRsOfCtorDtors(TemplateDecl->getTemplatedDecl());

[PATCH] D89233: [clangd] Refine recoveryAST flags in clangd

2020-10-14 Thread Haojian Wu 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 rG3fcca804b291: [clangd] Refine recoveryAST flags in clangd (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D89233: [clangd] Refine recoveryAST flags in clangd

2020-10-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clang-tools-extra/clangd/Compiler.cpp:84 - // Recovery expression currently only works for C++. - if (CI->getLangOpts()->CPlusPlus) { -CI->getLangOpts()->RecoveryAST =

[PATCH] D89233: [clangd] Refine recoveryAST flags in clangd

2020-10-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 298116. hokein added a comment. address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89233/new/ https://reviews.llvm.org/D89233 Files: clang-tools-extra/clangd/ClangdServer.h

[PATCH] D89300: [clang-rename] Fix rename on variable templates.

2020-10-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/include/clang/AST/DeclTemplate.h:3098 llvm::FoldingSetVector & - getPartialSpecializations(); + getPartialSpecializations() const; kbobyrev wrote: > I believe these are from https://reviews.llvm.org/D89221,

[PATCH] D89221: [clang-rename] Fix rename on function template specializations.

2020-10-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. @kbobyrev you may miss this patch, this is a separate patch from D89300 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89221/new/ https://reviews.llvm.org/D89221

[PATCH] D89221: [clang-rename] Fix rename on function template specializations.

2020-10-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 298061. hokein added a comment. update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89221/new/ https://reviews.llvm.org/D89221 Files: clang/lib/Tooling/Refactoring/Rename/USRFindingAction.cpp

[PATCH] D89220: [clang-rename] Simplify the code of handling class paritial specializations, NFC.

2020-10-14 Thread Haojian Wu 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 rG27c691cf62a9: [clang-rename] Simplify the code of handling class paritial specializations… (authored by hokein). Repository: rG LLVM Github

[PATCH] D89300: [clang-rename] Fix rename on variable templates.

2020-10-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: kbobyrev. Herald added a project: clang. hokein requested review of this revision. This patch adds support for renaming variable templates. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D89300 Files:

[PATCH] D89238: [clangd] Go-to-definition from non-renaming alias is unambiguous.

2020-10-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89238/new/ https://reviews.llvm.org/D89238

[PATCH] D88469: [clangd] Heuristic resolution for dependent type and template names

2020-10-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88469/new/ https://reviews.llvm.org/D88469

[PATCH] D89098: [clang] Fix returning the underlying VarDecl as top-level decl for VarTemplateDecl.

2020-10-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a subscriber: rsmith. hokein added a comment. > Is this https://github.com/clangd/clangd/issues/554 ? :-) Yeah, the github issue exposes multiple bugs, this is part of the fix. The AST of `VarTemplateSpeicalizationDecl` is a bit unusual, given the follow code, template bool X

[PATCH] D89131: [clangd] Validate optional fields more strictly.

2020-10-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. ah, I thought I clicked the accepted button. anyway, LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89131/new/ https://reviews.llvm.org/D89131 ___ cfe-commits mailing list

[PATCH] D89233: [clangd] Refine recoveryAST flags in clangd

2020-10-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: usaxena95, kadircet, arphaman. Herald added a project: clang. hokein requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. so that we could start experiment for C.

[PATCH] D89045: [AST][RecoveryExpr] Don't perform early typo correction in C.

2020-10-12 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG8852d30b1c1b: [AST][RecoveryExpr] Dont perform early typo correction in C. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89045/new/

[PATCH] D84304: [AST][RecoveryExpr] Part 2: Build dependent callexpr in C for error-recovery.

2020-10-12 Thread Haojian Wu 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 rGbb406f36dca3: [AST][RecoveryExpr] Build dependent callexpr in C for error-recovery. (authored by hokein). Repository: rG LLVM Github Monorepo

[PATCH] D89098: [clang] Fix returning the underlying VarDecl as top-level decl for VarTemplateDecl.

2020-10-12 Thread Haojian Wu 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 rG702529d899c8: [clang] Fix returning the underlying VarDecl as top-level decl for… (authored by hokein). Changed prior to commit:

[PATCH] D89131: [clangd] Validate optional fields more strictly.

2020-10-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/Protocol.cpp:800 + return O && O.map("applied", R.applied) && + O.mapOptional("failureReason", R.failureReason); } R.failureReason's type is `llvm::Optional`, I think we should

[PATCH] D89098: [clang] Fix returning the underlying VarDecl as top-level decl for VarTemplateDecl.

2020-10-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 297512. hokein marked 3 inline comments as done. hokein added a comment. address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89098/new/ https://reviews.llvm.org/D89098 Files:

[PATCH] D89221: [clang-rename] Fix rename on function template specializations.

2020-10-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: kbobyrev. Herald added a project: clang. hokein requested review of this revision. previously, we missed to rename occurrences to explicit function template specilizations. Repository: rG LLVM Github Monorepo

[PATCH] D89220: [clang-rename] Simplify the code of handling class paritial specializations, NFC.

2020-10-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: kbobyrev. Herald added a project: clang. hokein requested review of this revision. Instead of collecting all specializations and doing a post-filterin, we can just get all targeted specializations from getPartialSpecializationsizations.

[PATCH] D89098: [clang] Fix returning the underlying VarDecl as top-level decl for VarTemplateDecl.

2020-10-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: usaxena95, kadircet, arphaman, kristof.beyls. Herald added a project: clang. hokein requested review of this revision. Given the following VarTemplateDecl AST, VarTemplateDecl col:26 X

[PATCH] D89036: [clangd] Add more incomplete_type diagnostics that could be fixed by include-fixer.

2020-10-09 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGefd8c9ed726d: [clangd] Add more incomplete_type diagnostics that could be fixed by include… (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D89046: [AST] Build recovery expression by default for all language.

2020-10-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 296968. hokein added a comment. fix unexpected format changes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89046/new/ https://reviews.llvm.org/D89046 Files: clang/include/clang/Basic/LangOptions.def

[PATCH] D89046: [AST] Build recovery expression by default for all language.

2020-10-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added subscribers: cfe-commits, arphaman, kbarton, nemanjai. Herald added a project: clang. hokein requested review of this revision. Not intent to land it now, we need to run internal experiments to make sure this is not crashy. It is ready for review, all

[PATCH] D89045: [AST][RecoveryExpr] Don't perform early typo correction in C.

2020-10-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: clang. hokein requested review of this revision. The dependent mechanism for C error-recovery is mostly finished, this is the only place we have missed. Repository: rG LLVM Github Monorepo

[PATCH] D89036: [clangd] Add more incomplete_type diagnostics that could be fixed by include-fixer.

2020-10-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D89036#2319320 , @kadircet wrote: > Tests seem to be failing on premerge bots: > > - https://reviews.llvm.org/harbormaster/unit/view/177841/ > - https://reviews.llvm.org/harbormaster/unit/view/177842/ opps, sorry -- I made a

[PATCH] D89036: [clangd] Add more incomplete_type diagnostics that could be fixed by include-fixer.

2020-10-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 296961. hokein added a comment. Fix the test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89036/new/ https://reviews.llvm.org/D89036 Files: clang-tools-extra/clangd/IncludeFixer.cpp

[PATCH] D89036: [clangd] Add more incomplete_type diagnostics that could be fixed by include-fixer.

2020-10-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: kadircet. Herald added subscribers: usaxena95, arphaman. Herald added a project: clang. hokein requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. Repository: rG LLVM Github Monorepo

[PATCH] D88964: [clangd] Add a missing include-fixer test for incomplete_type, NFC.

2020-10-08 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa4e27220c2a1: [clangd] Add a missing include-fixer test for incomplete_type, NFC. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D88964: [clangd] Add a missing include-fixer test for incomplete_type, NFC.

2020-10-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp:738 +"Add include \"x.h\" for symbol ns::X"))), + AllOf(Diag(Test.range("nested"), + "incomplete type 'ns::X' named in

[PATCH] D84304: [AST][RecoveryExpr] Part 2: Build dependent callexpr in C for error-recovery.

2020-10-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 296885. hokein added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84304/new/ https://reviews.llvm.org/D84304 Files: clang/lib/Sema/SemaExpr.cpp clang/test/AST/ast-dump-recovery.c

[PATCH] D84387: [AST][RecoveryExpr] Part4: Support dependent cast-expr in C for error-recovery.

2020-10-08 Thread Haojian Wu 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 rGa96bcfb19674: [AST][RecoveryExpr] Support dependent cast-expr in C for error-recovery. (authored by hokein). Changed prior to commit:

[PATCH] D88881: [clangd] Add a NewName optional parameter to clangdServer::prepareRename.

2020-10-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/ClangdServer.h:277 + /// + /// If NewName is provided, it peforms a name validation. void prepareRename(PathRef File, Position Pos, danielmartin wrote: > oh, thanks! Fixed in

[PATCH] D88881: [clangd] Add a NewName optional parameter to clangdServer::prepareRename.

2020-10-07 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9c09e2055ee4: [clangd] Add a NewName optional parameter to clangdServer::prepareRename. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D88964: [clangd] Add a missing include-fixer test for incomplete_type, NFC.

2020-10-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 296767. hokein added a comment. update: don't change the order in test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88964/new/ https://reviews.llvm.org/D88964 Files:

[PATCH] D88964: [clangd] Add a missing include-fixer test for incomplete_type, NFC.

2020-10-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp:709 ns::X *x; + auto& $type[[[]]a] = *x; x$access[[->]]f(); kadircet wrote: > should this be `$type[[a]]` ? yeah, but this is the actual diagnostic range,

[PATCH] D88964: [clangd] Add a missing include-fixer test for incomplete_type, NFC.

2020-10-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: kadircet. Herald added subscribers: usaxena95, arphaman. Herald added a project: clang. hokein requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. Also sort the list to make it easier to verify with the

[PATCH] D84304: [AST][RecoveryExpr] Part 2: Build dependent callexpr in C for error-recovery.

2020-10-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:6444 + "should only occur in error-recovery path."); +return CallExpr::Create(Context, Fn, ArgExprs, Context.DependentTy, +VK_RValue, RParenLoc);

[PATCH] D84304: [AST][RecoveryExpr] Part 2: Build dependent callexpr in C for error-recovery.

2020-10-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 296634. hokein added a comment. fix format. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84304/new/ https://reviews.llvm.org/D84304 Files: clang/lib/Sema/SemaExpr.cpp clang/test/AST/ast-dump-recovery.c

[PATCH] D84304: [AST][RecoveryExpr] Part 2: Build dependent callexpr in C for error-recovery.

2020-10-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 296633. hokein marked 4 inline comments as done. hokein added a comment. address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84304/new/ https://reviews.llvm.org/D84304 Files:

[PATCH] D88881: [clangd] Add a NewName optional parameter to clangdServer::prepareRename.

2020-10-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D1#2313863 , @sammccall wrote: > Can you add a bit more context to the commit message? > > And should we expose this as an extension on `textDocument/prepareRename`? no needed right now. AFAIK, there are no lsp clients that

[PATCH] D88881: [clangd] Add a NewName optional parameter to clangdServer::prepareRename.

2020-10-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 296622. hokein marked an inline comment as done. hokein added a comment. make NewName optional. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1/new/ https://reviews.llvm.org/D1 Files:

[PATCH] D88472: [clangd] Don't set the Underlying bit on targets of UsingDecls.

2020-10-07 Thread Haojian Wu 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 rGf24649b77d85: [clangd] Dont set the Underlying bit on targets of UsingDecls. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D88472: [clangd] Don't set the Underlying bit on targets of UsingDecls.

2020-10-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/unittests/XRefsTests.cpp:1121 namespace ns { class [[Foo]] {}; } - using ns::F^oo; + using ns::[[F^oo]]; )cpp", sammccall wrote: > I'd like to make a plan to solve this

[PATCH] D88472: [clangd] Don't set the Underlying bit on targets of UsingDecls.

2020-10-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 296612. hokein marked 2 inline comments as done. hokein added a comment. address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88472/new/ https://reviews.llvm.org/D88472 Files:

[PATCH] D84387: [AST][RecoveryExpr] Part4: Suppress spurious "err_typecheck_expect_scalar_operand" diagnostic

2020-10-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. > I'm not sure I love having the assertion for contains-errors every place that > handles dependent code in C. My feeling is that the assertion would help for understanding the code (comparing with documenting it somewhere), and we don't have too many places.

[PATCH] D84387: [AST][RecoveryExpr] Part4: Suppress spurious "err_typecheck_expect_scalar_operand" diagnostic

2020-10-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 296611. hokein marked an inline comment as done. hokein added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84387/new/ https://reviews.llvm.org/D84387 Files: clang/lib/Sema/SemaCast.cpp

[PATCH] D84322: [AST][RecoveryExpr] Part3: Support dependent conditional operators in C for error recovery.

2020-10-07 Thread Haojian Wu 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 rG334ec6f807fa: [AST][RecoveryExpr] Support dependent conditional operators in C for error… (authored by hokein). Repository: rG LLVM Github

[PATCH] D84322: [AST][RecoveryExpr] Part3: Support dependent conditional operators in C for error recovery.

2020-10-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 296609. hokein marked 2 inline comments as done. hokein added a comment. address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84322/new/ https://reviews.llvm.org/D84322 Files:

[PATCH] D84322: [AST][RecoveryExpr] Part3: Support dependent conditional operators in C for error recovery.

2020-10-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/test/Sema/error-dependence.c:18 + // type is required" is not emitted. + ptr > f ? ptr : f; // expected-error {{invalid operands to binary expression}} +} sammccall wrote: > hokein wrote: > > sammccall wrote: >

[PATCH] D88875: [clangd] Add basic keyword-name-validation in rename.

2020-10-06 Thread Haojian Wu 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 rG8a3cbb1535a9: [clangd] Add basic keyword-name-validation in rename. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D88875: [clangd] Add basic keyword-name-validation in rename.

2020-10-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/ClangdServer.cpp:416 +auto Results = clangd::rename( +{Pos, /*NewName=*/"__clangd_rename_dummy", InpAST->AST, File, + RenameOpts.AllowCrossFile ? nullptr : Index, RenameOpts});

[PATCH] D88875: [clangd] Add basic keyword-name-validation in rename.

2020-10-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/refactor/Rename.cpp:124 + + // name validation. + RenameToKeywords, sammccall wrote: > nit: not sure we need a separate section for these, I can imagine at most > keyword/conflict/shadow yeah,

[PATCH] D88875: [clangd] Add basic keyword-name-validation in rename.

2020-10-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 296438. hokein marked an inline comment as done. hokein added a comment. address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88875/new/ https://reviews.llvm.org/D88875 Files:

[PATCH] D88881: [clangd] Add a NewName optional parameter to clangdServer::prepareRename.

2020-10-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: usaxena95, kadircet, arphaman. Herald added a project: clang. hokein requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. so that our embedders can implement customized

[PATCH] D88828: [clangd] Verify the diagnostic code in include-fixer diagnostic tests, NFC.

2020-10-06 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG48a82c42457b: [clangd] Verify the diagnostic code in include-fixer diagnostic tests, NFC. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D88828: [clangd] Verify the diagnostic code in include-fixer diagnostic tests, NFC.

2020-10-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D88828#2311679 , @kadircet wrote: > LGTM, but can you add some description about why you've decided to do it now > :D yeah, this comes up when I read the code, I think it is easier to spot which diagnostics in the

[PATCH] D88875: [clangd] Add basic keyword-name-validation in rename.

2020-10-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: usaxena95, kadircet, arphaman. Herald added a project: clang. hokein requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. Repository: rG LLVM Github Monorepo

[PATCH] D84322: [AST][RecoveryExpr] Part3: Suppress spurious "typecheck_cond_expect_scalar" diagnostic

2020-10-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/test/Sema/error-dependence.c:18 + // type is required" is not emitted. + ptr > f ? ptr : f; // expected-error {{invalid operands to binary expression}} +} sammccall wrote: > nit: parens would help me understand

[PATCH] D84322: [AST][RecoveryExpr] Part3: Suppress spurious "typecheck_cond_expect_scalar" diagnostic

2020-10-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 296374. hokein added a comment. rebase and add ast-dump test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84322/new/ https://reviews.llvm.org/D84322 Files: clang/lib/Sema/SemaExpr.cpp

[PATCH] D84226: [AST][RecoveryExpr] Part1: Support dependent binary operator in C for error recovery.

2020-10-06 Thread Haojian Wu 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 rG70d9dc867417: [AST][RecoveryExpr] Support dependent binary operator in C for error recovery. (authored by hokein). Repository: rG LLVM Github

[PATCH] D84226: [AST][RecoveryExpr] Part1: Support dependent binary operator in C for error recovery.

2020-10-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 296367. hokein marked 2 inline comments as done. hokein added a comment. address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84226/new/ https://reviews.llvm.org/D84226 Files:

[PATCH] D84226: [AST][RecoveryExpr] Part1: Support dependent binary operator in C for error recovery.

2020-10-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:14365 + "Should only occur in error-recovery path."); +if (BinaryOperator::isCompoundAssignmentOp(Opc)) + return CompoundAssignOperator::Create( sammccall wrote: >

[PATCH] D84226: [AST][RecoveryExpr] Part1: Support dependent binary operator in C for error recovery.

2020-10-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 296218. hokein marked 2 inline comments as done. hokein added a comment. address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84226/new/ https://reviews.llvm.org/D84226 Files:

[PATCH] D88810: [clangd] Add isKeyword function.

2020-10-05 Thread Haojian Wu 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 rG1425c7223676: [clangd] Add isKeyword function. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D88810: [clangd] Add isKeyword function.

2020-10-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/SourceCode.cpp:638 + // Keywords are initialized in constructor. + clang::IdentifierTable KeywordsTable(LangOpts); + return KeywordsTable.find(NewName) != KeywordsTable.end(); sammccall wrote:

[PATCH] D88810: [clangd] Add isKeyword function.

2020-10-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 296168. hokein marked an inline comment as done. hokein added a comment. address code comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88810/new/ https://reviews.llvm.org/D88810 Files:

[PATCH] D88828: [clangd] Verify the diagnostic code in include-fixer diagnostic tests, NFC.

2020-10-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: kadircet. Herald added subscribers: usaxena95, arphaman. Herald added a project: clang. hokein requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. Repository: rG LLVM Github Monorepo

[PATCH] D87350: [AST][RecoveryExpr] Fix a crash on undeduced type.

2020-10-05 Thread Haojian Wu 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 rG7f05fe1aeeb0: [AST][RecoveryExpr] Fix a crash on undeduced type. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D84226: [AST][RecoveryExpr] Part1: Support dependent binary operator in C for error recovery.

2020-10-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. I think this patch is ready for another round of review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84226/new/ https://reviews.llvm.org/D84226 ___ cfe-commits mailing list

[PATCH] D87350: [AST][RecoveryExpr] Fix a crash on undeduced type.

2020-10-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/lib/Sema/SemaOverload.cpp:12880 return Result.getValueOr(QualType()); } sammccall wrote: > hokein wrote: > > sammccall wrote: > > > Wouldn't we be better to handle undeduced type here rather than in the > >

[PATCH] D87350: [AST][RecoveryExpr] Fix a crash on undeduced type.

2020-10-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 296120. hokein added a comment. address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87350/new/ https://reviews.llvm.org/D87350 Files: clang/lib/Sema/SemaOverload.cpp

[PATCH] D86048: [AST][RecoveryExpr] Popagate the error-bit from a VarDecl's initializer to DeclRefExpr.

2020-10-05 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG3423d5c9da81: [AST][RecoveryExpr] Popagate the error-bit from a VarDecls initializer to… (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D86048: [AST][RecoveryExpr] Popagate the error-bit from a VarDecl's initializer to DeclRefExpr.

2020-10-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. @rsmith I'm landing this patch now. Happy to follow-up if you have other comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86048/new/ https://reviews.llvm.org/D86048 ___

[PATCH] D88469: [clangd] Heuristic resolution for dependent type and template names

2020-10-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/FindTarget.cpp:578 +for (const NamedDecl *ND : getMembersReferencedViaDependentName( + resolveNestedNameSpecifierToType(DTST->getQualifier()), + [DTST](ASTContext &) {

[PATCH] D88810: [clangd] Add isKeyword function.

2020-10-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: usaxena95, kadircet, arphaman. Herald added a project: clang. hokein requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. This will be used in rename for doing basic name

[PATCH] D88634: [clangd] Extend the rename API.

2020-10-02 Thread Haojian Wu 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 rG0f0cbcc4b166: [clangd] Extend the rename API. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D88634: [clangd] Extend the rename API.

2020-10-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 295819. hokein marked an inline comment as done. hokein added a comment. change LocalChanges type to vector Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88634/new/ https://reviews.llvm.org/D88634 Files:

[PATCH] D88634: [clangd] Extend the rename API.

2020-10-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/refactor/Rename.h:61 + Range R; + FileEdits Edits; +}; sammccall wrote: > hokein wrote: > > sammccall wrote: > > > It's slightly awkward to have the half-populated state (may or may not > > >

[PATCH] D88634: [clangd] Extend the rename API.

2020-10-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 295798. hokein marked 2 inline comments as done. hokein added a comment. address comment: add the LocalChanges field in RenameResult. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88634/new/

[PATCH] D88634: [clangd] Extend the rename API.

2020-10-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/ClangdServer.cpp:416 +auto Results = clangd::rename( +{Pos, "dummy", InpAST->AST, File, + RenameOpts.AllowCrossFile ? : Index, RenameOpts}); sammccall wrote: > we're now

[PATCH] D88634: [clangd] Extend the rename API.

2020-10-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 295747. hokein marked 6 inline comments as done. hokein added a comment. address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88634/new/ https://reviews.llvm.org/D88634 Files:

[PATCH] D88640: [Format] Don't treat compound extension headers (foo.proto.h) as foo.cc main file.

2020-10-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein closed this revision. hokein marked an inline comment as done. hokein added a comment. committed in c1b209cc61290f1ce1243470b825e0994645cb7d . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D88640: [Format] Don't treat compound extension headers (foo.proto.h) as foo.cc main file.

2020-10-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: clang. hokein requested review of this revision. We receive internal bugs about this false positives after D86597 . Repository: rG LLVM Github Monorepo

[PATCH] D88634: [clangd] Extend the rename API.

2020-10-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: usaxena95, kadircet, arphaman. Herald added a project: clang. hokein requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. several changes: - return a structure result in

[PATCH] D88472: [WIP][clangd] Support non-renaming alias underlying decls in TargetDecl.

2020-09-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/unittests/XRefsTests.cpp:1120 namespace ns { class [[Foo]] {}; } - using ns::F^oo; + using ns::[[F^oo]]; )cpp", sammccall wrote: > hokein wrote: > > this seems a small

[PATCH] D88472: [WIP][clangd] Support non-renaming alias underlying decls in TargetDecl.

2020-09-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 295238. hokein added a comment. refine the patch based on the offline discussion: - don't set the Underlying bits for using-declaration's underlying decl. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D88469: [clangd] Heuristic resolution for dependent type and template names

2020-09-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/FindTarget.cpp:128 const auto ValueFilter = [](const NamedDecl *D) { return isa(D); }; +const auto TypeFilter = [](const NamedDecl *D) { return !isa(D); }; nridge wrote: > hokein wrote: > >

[PATCH] D88472: [WIP][clangd] Support non-renaming alias underlying decls in TargetDecl.

2020-09-29 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/FindTarget.h:112 + /// Underlying declarations for renaming alias (typedef decl, type alias decl) + AliasUnderlying, + /// Underlying declarations for non-renaming alias, decltype, etc. The

[PATCH] D88472: [WIP][clangd] Support non-renaming alias underlying decls in TargetDecl.

2020-09-29 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman. Herald added a project: clang. hokein requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. Extend the TargetDecl API to fix the workaround in

[PATCH] D88469: [clangd] Heuristic resolution for dependent type and template names

2020-09-29 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/FindTarget.cpp:128 const auto ValueFilter = [](const NamedDecl *D) { return isa(D); }; +const auto TypeFilter = [](const NamedDecl *D) { return !isa(D); }; why not using `isa(D)`?

  1   2   3   4   5   6   7   8   9   10   >