[PATCH] D81958: [clangd] Add library to semantically strip flags by name.

2020-07-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. still lg. Comment at: clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp:197 +} + +TEST(ArgStripperTest, Spellings) { sammccall wrote: > hokein wrote: > > sammccall wrote: > > > hokein wrote: > > >

[PATCH] D82086: [AST][RecoveryExpr] Fix a crash: don't attach error-type base specifiers.

2020-06-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: clang. hokein edited the summary of this revision. otherwise we'll run into code path which expects a good base specifiers, and lead to crashes. The crash only occurs in template instantiations (in non-templ

[PATCH] D82086: [AST][RecoveryExpr] Fix a crash: don't attach error-type base specifiers.

2020-06-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clang/test/SemaCXX/invalid-template-base-specifier.cpp:6 +template +struct Crash : decltype(Foo(T())) { // expected-error {{no matching function for call to 'Foo'}} + Crash(){};

[PATCH] D82099: [AST][RecoveryAST] Populate error-bit from Type to Expr.

2020-06-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: clang. Looks like this is a fallout when we introduce the error-bit in Type. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D82099 Files: clang/include/clang/AST/DependenceFlags.h clan

[PATCH] D82102: [AST][RecoveryExpr] Populate the error-bit from template arguments to TemplateSepcializationType.

2020-06-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D82102 Files: clang/lib/AST/Type.cpp clang/test/SemaCXX/invalid-template-base-specifier.cpp Index: clang/test/SemaCXX/invalid-temp

[PATCH] D81912: [AST] Dump containsErrors bit for the Type.

2020-06-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 271733. hokein added a comment. address comment: emit the error-bit with color. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81912/new/ https://reviews.llvm.org/D81912 Files: clang/lib/AST/JSONNodeDumper.cpp

[PATCH] D81912: [AST] Dump containsErrors bit for the Type.

2020-06-18 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. hokein marked an inline comment as done. Closed by commit rG493d8059f399: [AST] Dump containsErrors bit for the Type. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.

[PATCH] D81395: [AST][RecoveryExpr] Preserve the invalid "undef_var" initializer.

2020-06-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 271928. hokein marked 2 inline comments as done. hokein added a comment. rebase to head. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81395/new/ https://reviews.llvm.org/D81395 Files: clang/lib/Sema/SemaDecl

[PATCH] D80981: [AST] Fix a crash on accessing a class without definition in constexpr function context.

2020-06-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 272019. hokein added a comment. cleanup the debug code. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80981/new/ https://reviews.llvm.org/D80981 Files: clang/lib/AST/ExprConstant.cpp clang/test/SemaCXX/cons

[PATCH] D80981: [AST] Fix a crash on accessing a class without definition in constexpr function context.

2020-06-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 272018. hokein marked an inline comment as done. hokein added a comment. Update per Richard's comment: do the error check in getDefaultInitValue, and modify every caller of it to support the error handling. Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D80981: [AST] Fix a crash on accessing a class without definition in constexpr function context.

2020-06-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:4320 +if (!RD->hasDefinition()) + return APValue(); APValue Struct(APValue::UninitStruct(), RD->getNumBases(), rsmith wrote: > hokein wrote: > > rsmith wrote: > > > hokein wrot

[PATCH] D82284: [AST][RecoveryAST] Preseve invalid return stmt, and suppress the diagnostics for missing return stmt in constexpr func.

2020-06-22 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D82284 Files: clang/lib/Sema/SemaStmt.cpp clang/test/AST/ast-dump-recovery.cpp clang/test/SemaCXX/constant-expression-cxx11.cpp

[PATCH] D82099: [AST][RecoveryAST] Populate error-bit from Type to Expr.

2020-06-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked 2 inline comments as done. hokein added inline comments. Comment at: clang/include/clang/AST/DependenceFlags.h:123 + translate(D, TypeDependence::Dependent, Dependent) | + translate(D, TypeDependence::Error, Error) | + translate(D, TypeDep

[PATCH] D82099: [AST][RecoveryAST] Populate error-bit from Type to Expr.

2020-06-24 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. hokein marked an inline comment as done. Closed by commit rGbfec030e69af: [AST][RecoveryExpr] Populate error-bit from Type to Expr. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION ht

[PATCH] D82086: [AST][RecoveryExpr] Fix a crash: don't attach error-type base specifiers.

2020-06-24 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. hokein marked an inline comment as done. Closed by commit rGf0084c3bcbc2: [AST][RecoveryExpr] Fix a crash: don't attach error-type base specifiers. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D

[PATCH] D82102: [AST][RecoveryExpr] Populate the error-bit from template arguments to TemplateSepcializationType.

2020-06-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 272963. hokein added a comment. per offline discussion: add error-bit to TemplateArgument which provide a more general fix for missing error-bit in the code path: "error type/expr" -> "teample argument" -> "template specialization typ". Repository: rG LLVM

[PATCH] D82102: [AST][RecoveryExpr] Add error-bit TemplateArgument

2020-06-24 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5f94c9a421ec: [AST][RecoveryExpr] Add error-bit TemplateArgument (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82102/new/ https://revi

[PATCH] D82526: [AST][RecoveryExpr] Add error-bit to NestNameSpecifierDependence and TemplateNameDependence.

2020-06-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: clang. We might lose the error-bit if the error-bit goes through the code path "error type/expr" -> "error template argument" -> "nested name specifier" -> ... -> "template Specialization type" Template name

[PATCH] D80981: [AST] Fix a crash on accessing a class without definition in constexpr function context.

2020-06-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 273281. hokein marked 5 inline comments as done. hokein added a comment. address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80981/new/ https://reviews.llvm.org/D80981 Files: clang/lib/AST/ExprCon

[PATCH] D80981: [AST] Fix a crash on accessing a class without definition in constexpr function context.

2020-06-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks for the review! Comment at: clang/lib/AST/ExprConstant.cpp:4320 +if (!RD->hasDefinition()) + return APValue(); APValue Struct(APValue::UninitStruct(), RD->getNumBases(), rsmith wrote: > hokein wrote: > > rsmith wrote

[PATCH] D80981: [AST] Fix a crash on accessing a class without definition in constexpr function context.

2020-06-25 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9fb7e98db5aa: [AST] Fix a crash on accessing a class without definition in constexpr function… (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D82631: [AST][RecoveryAST] Avoid spurious 'missing typename' diagnostic when the NNS contains errors.

2020-06-26 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D82631 Files: clang/include/clang/AST/NestedNameSpecifier.h clang/lib/AST/NestedNameSpecifier.cpp clang/lib/Sema/SemaDecl.cpp cl

[PATCH] D82657: [AST][RecoveryAST] Preserve the type by default for recovery expression.

2020-06-26 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. DO NOT SUBMIT. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D82657 Files: clang/lib/Frontend/CompilerInvocation.cpp clang/test/CXX/temp/temp.constr/temp.constr.order/funct

[PATCH] D82738: [clang] Fix a null-NSS-access crash in DependentNameType.

2020-06-29 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: clang. The DependentNameType must have a non-null NSS. This property could be violated during typo correction. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D82738 Files: clang/lib/Sema

[PATCH] D82701: [clangd][Hover] Dont crash on null types

2020-06-29 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, I was going to prepare a patch this morning, then realized this one. Comment at: clang-tools-extra/clangd/Hover.cpp:302 P.Type = printType(PVD->getType(), Poli

[PATCH] D82612: [clangd] Config: compile Fragment -> CompiledFragment -> Config

2020-06-29 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/CMakeLists.txt:41 + ConfigCompile.cpp ConfigYAML.cpp Diagnostics.cpp we have a few config-related files now, I wonder would it make sense to create a config/ subdir? Com

[PATCH] D82771: [ASTMatcher] Fix a performance regression: memorize the child match.

2020-06-29 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added reviewers: klimek, sammccall. Herald added a project: clang. D80025 introduced a performance regression: in some cases, it makes clang-tidy readability-container-size-empty ~80x slower (running on an internal huge TU, be

[PATCH] D82526: [AST][RecoveryExpr] Add error-bit to NestNameSpecifierDependence and TemplateNameDependence.

2020-06-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. friendly ping, we start encountering this crash in production. another reduced testcase: using a = decltype(b())::a; template < class c > class d { using UnderlyingBuilder = c::UnderlyingBuilder:template < class > class e class f { using g = Un

[PATCH] D82771: [ASTMatcher] Fix a performance regression: memorize the child match.

2020-06-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added a comment. In D82771#2120214 , @klimek wrote: > In what situation are we calling child matchers repeatedly with the same > matcher on the same node? I guess a pattern like https://github.com/llvm/ll

[PATCH] D82771: [ASTMatcher] Fix a performance regression: memorize the child match.

2020-06-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 274347. hokein added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82771/new/ https://reviews.llvm.org/D82771 Files: clang/lib/ASTMatchers/ASTMatchFinder.cpp Index: clang/lib/AS

[PATCH] D82612: [clangd] Config: compile Fragment -> CompiledFragment -> Config

2020-06-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/CMakeLists.txt:41 + ConfigCompile.cpp ConfigYAML.cpp Diagnostics.cpp sammccall wrote: > hokein wrote: > > we have a few config-related files now, I wonder would it make sense to > > create

[PATCH] D82526: [AST][RecoveryExpr] Add error-bit to NestNameSpecifierDependence and TemplateNameDependence.

2020-06-30 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd28267f9810c: [AST][RecoveryExpr] Add error-bit to NestNameSpecifierDependence and… (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82526

[PATCH] D82771: [ASTMatcher] Fix a performance regression: memorize the child match.

2020-06-30 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9f865246a817: [ASTMatcher] Fix a performance regression: memorize the child match. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82771/

[PATCH] D82631: [AST][RecoveryAST] Avoid spurious 'missing typename' diagnostic when the NNS contains errors.

2020-06-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 274463. hokein added a comment. rename the test file. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82631/new/ https://reviews.llvm.org/D82631 Files: clang/include/clang/AST/NestedNameSpecifier.h clang/lib/

[PATCH] D82631: [AST][RecoveryAST] Avoid spurious 'missing typename' diagnostic when the NNS contains errors.

2020-06-30 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd285f29317d6: [AST][RecoveryExpr] Avoid spurious 'missing typename' diagnostic when the NNS… (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D82612: [clangd] Config: compile Fragment -> CompiledFragment -> Config

2020-06-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/ConfigCompile.cpp:65 +if (F.HasUnrecognizedCondition) + Conditions.push_back([&](const Params &) { return false; }); + sammccall wrote: > hokein wrote: > > I think if this case happened,

[PATCH] D82612: [clangd] Config: compile Fragment -> CompiledFragment -> Config

2020-06-30 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, looks good. Comment at: clang-tools-extra/clangd/ConfigCompile.cpp:65 +if (F.HasUnrecognizedCondition) + Conditions.push_back([&](const Params &) { return fa

[PATCH] D78139: [clang-tidy] modernize-use-using: Fix broken fixit with 'template' keyword

2020-04-16 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 for fixing this. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78139/new/ https://reviews.llvm.org/D78139

[PATCH] D78284: [AST] Fix an undefine behavior when creating an empty recovery expr.

2020-04-16 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG94d6dd01ba43: [AST] Fix an undefine behavior when creating an empty recovery expr. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78284/

[PATCH] D78116: [AST] dont invaliate VarDecl when the initializer contains errors.

2020-04-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 258169. hokein marked 5 inline comments as done. hokein added a comment. address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78116/new/ https://reviews.llvm.org/D78116 Files: clang/lib/Sema/SemaDec

[PATCH] D78116: [AST] dont invaliate VarDecl when the initializer contains errors.

2020-04-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:11998 ExprResult Result = InitSeq.Perform(*this, Entity, Kind, Args, &DclT); if (Result.isInvalid()) { + auto RecoveryExpr = sammccall wrote: > if the variable is an undeduced au

[PATCH] D78338: [clangd] Enable diagnostic fixes within macro argument expansions.

2020-04-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/Diagnostics.cpp:563 +for (auto &FixIt : FixIts) { + // Allow fixits within a single macro-arg expansion to be applied. + if (FixIt.RemoveRange.getBegin().isMacroID() && I feel a bit

[PATCH] D78350: [AST] Build recovery expressions by default for C++.

2020-04-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 258268. hokein added a comment. Herald added subscribers: usaxena95, kadircet, arphaman, jkorous. fix clangd test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78350/new/ https://reviews.llvm.org/D78350 Files:

[PATCH] D78350: [AST] Build recovery expressions by default for C++.

2020-04-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. hokein updated this revision to Diff 258268. hokein added a comment. Herald added subscribers: usaxena95, kadircet, arphaman, jkorous. hokein added subscribers: ebevhan, hubert.reinterpretcast. fix

[PATCH] D78350: [AST] Build recovery expressions by default for C++.

2020-04-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein added subscribers: ebevhan, hubert.reinterpretcast. hokein added a comment. @ebevhan, @hubert.reinterpretcast, the patch is based on fd7a34186137168064ffe2ca536823559b92d939 , it should contain all the fixes. it would b

[PATCH] D78365: [AST] Preserve the invalid initializer for auto VarDecl.

2020-04-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: usaxena95, kadircet, ilya-biryukov. Herald added a project: clang. fixes https://github.com/clangd/clangd/issues/330 Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D78365 Files: clang/

[PATCH] D78338: [clangd] Enable diagnostic fixes within macro argument expansions.

2020-04-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/Diagnostics.cpp:563 +for (auto &FixIt : FixIts) { + // Allow fixits within a single macro-arg expansion to be applied. + if (FixIt.RemoveRange.getBegin().isMacroID() && sammccall wro

[PATCH] D78100: [AST] Suppress the spammy "attempt to use a deleted fucntion" diagnostic.

2020-04-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:12565 + auto RecoveryExpr = + CreateRecoveryExpr(Var->getLocation(), Var->getEndLoc(), {}); + if (RecoveryExpr.get()) sammccall wrote

[PATCH] D78100: [AST] Suppress the spammy "attempt to use a deleted fucntion" diagnostic.

2020-04-21 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe90fb82f0f76: [AST] Suppress the spammy "attempt to use a deleted fucntion" diagnostic. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D78100?vs=257689&id=258918#toc Repository

[PATCH] D78546: Enable bugprone-argument-comments check in llvm.

2020-04-21 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: llvm-commits, aheejin. Herald added a project: LLVM. LLVM code style encourages this [1], this check can detect the missing cases and provide an automatic fixit. [1] https://llvm.org/docs/CodingStandards.h

[PATCH] D78116: [AST] dont invaliate VarDecl when the initializer contains errors.

2020-04-21 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. hokein marked an inline comment as done. Closed by commit rG89d9912cbf45: [AST] dont invaliate VarDecl when the initializer contains errors. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D78116?v

[PATCH] D78365: [AST] Preserve the invalid initializer for auto VarDecl.

2020-04-21 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:11852 + // There are unresolved typos in Init. Usually it indicates the + // initializer is very ill-formed, just drop it. RealDecl->setInvalidDecl(); -

[PATCH] D78598: [clangd] Remove vscode plugin: now https://github.com/clangd/vscode-clangd

2020-04-22 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. > Is there an easy way to transplant patches written against the old repo, into > the new one? I don't know whether there is an easy way, I'd just copy the changed file from the old repo to new repo, and regenerate a diff, I think this is not too terrible given that we

[PATCH] D78598: [clangd] Remove vscode plugin: now https://github.com/clangd/vscode-clangd

2020-04-22 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 for doing it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78598/new/ https://reviews.llvm.org/D78598 ___

[PATCH] D78626: [clangd] Fix a crash for accessing a null template decl returned by findExplicitReferences.

2020-04-22 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: kadircet. Herald added subscribers: usaxena95, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. Fixes https://github.com/clangd/clangd/issues/347. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D7862

[PATCH] D78626: [clangd] Fix a crash for accessing a null template decl returned by findExplicitReferences.

2020-04-22 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/unittests/FindTargetTests.cpp:1293 +struct Base {}; +namespace foo { +template kadircet wrote: > is namespace required? yes, the t

[PATCH] D78626: [clangd] Fix a crash for accessing a null template decl returned by findExplicitReferences.

2020-04-22 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG7d1ee639cb9e: [clangd] Fix a crash for accessing a null template decl returned by… (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78626/

[PATCH] D50078: clang-format: support aligned nested conditionals formatting

2020-04-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D50078#1998520 , @Typz wrote: > In D50078#1998398 , @dyung wrote: > > > Hi, this change that you submitted in commit > > 5daa25fd7a184524759b6ad065a8bd7e95aa149a > >

[PATCH] D78350: [AST] Build recovery expressions by default for C++.

2020-04-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 259514. hokein added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78350/new/ https://reviews.llvm.org/D78350 Files: clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp clang/include/

[PATCH] D78715: [clangd] Fix modernize-loop-convert "multiple diag in flight" crash.

2020-04-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: usaxena95, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. this maybe not ideal, but it is trivial and does fix the crash. Fixes https://github.com/clangd/clangd/issues

[PATCH] D78715: [clangd] Fix modernize-loop-convert "multiple diag in flight" crash.

2020-04-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D78715#1999236 , @sammccall wrote: > Ah, nice work! > Agree it's a hack (and how many more instances are lurking) but I don't know > how better to fix it and it's been reported 3 times... this is the only place in clang-tidy

[PATCH] D78715: [clangd] Fix modernize-loop-convert "multiple diag in flight" crash.

2020-04-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 259832. hokein marked 3 inline comments as done. hokein added a comment. refine the fix. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78715/new/ https://reviews.llvm.org/D78715 Files: clang-tools-extra/clang

[PATCH] D78715: [clangd] Fix modernize-loop-convert "multiple diag in flight" crash.

2020-04-24 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa466e4be3831: [clangd] Fix modernize-loop-convert "multiple diag in flight" crash. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78715/

[PATCH] D78365: [AST] Preserve the invalid initializer for auto VarDecl.

2020-04-27 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG1a0d46608131: [AST] Preserve the invalid initializer for auto VarDecl. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D78365?vs=258309&id=260241#toc Repository: rG LLVM Githu

[PATCH] D78350: [AST] Build recovery expressions by default for C++.

2020-04-27 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 260306. hokein added a comment. rebase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78350/new/ https://reviews.llvm.org/D78350 Files: clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp clang/include

[PATCH] D78350: [AST] Build recovery expressions by default for C++.

2020-04-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked 8 inline comments as done. hokein added a comment. In D78350#2006469 , @hubert.reinterpretcast wrote: > In D78350#1988416 , @hokein wrote: > > > @ebevhan, @hubert.reinterpretcast, the patch is based o

[PATCH] D78350: [AST] Build recovery expressions by default for C++.

2020-04-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 260552. hokein added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78350/new/ https://reviews.llvm.org/D78350 Files: clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp clang/include/

[PATCH] D78985: [clang-tidy] NFC: Cleanup Python scripts

2020-04-28 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 for cleaning up. Comment at: clang-tools-extra/clang-tidy/add_new_check.py:1 -#!/usr/bin/env python +#!/usr/bin/env python3 # we should keep using `p

[PATCH] D79009: [AST] Preserve the incomplete-type member expr.

2020-04-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D79009 Files: clang/lib/Sema/SemaExprCXX.cpp clang/test/AST/ast-dump-recovery.cpp Index: clang/test/AST/ast-dump-recovery.cpp

[PATCH] D79009: [AST] Preserve the incomplete-type member expr.

2020-04-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein abandoned this revision. hokein marked an inline comment as done. hokein added inline comments. Comment at: clang/test/AST/ast-dump-recovery.cpp:107 +struct Incomplete; +Incomplete make_incomplete(); sammccall wrote: > This test doesn't seem to relate to

[PATCH] D79160: [AST] Preserve the type in RecoveryExprs for broken function calls.

2020-04-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added subscribers: cfe-commits, arphaman. Herald added a project: clang. RecoveryExprs was modeled as dependent type to prevent bogus diagnostics and crashes in clang. This patch allows to preseve the type for broken calls when the RecoveryEprs have a known ty

[PATCH] D79160: [AST] Preserve the type in RecoveryExprs for broken function calls.

2020-04-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 261167. hokein marked 3 inline comments as done. hokein added a comment. update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79160/new/ https://reviews.llvm.org/D79160 Files: clang/include/clang/AST/Expr.h

[PATCH] D79160: [AST] Preserve the type in RecoveryExprs for broken function calls.

2020-04-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/lib/Sema/SemaOverload.cpp:12779 +// Guess at what the return type for an unresolvable overload should be. +static QualType chooseRecoveryType(OverloadCandidateSet &CS, I steal this function from D61722.

[PATCH] D78350: [AST] Build recovery expressions by default for C++.

2020-04-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added a comment. In D78350#2009345 , @hubert.reinterpretcast wrote: > In D78350#2007065 , @hokein wrote: > > > In D78350#2006469

[PATCH] D79106: [clangd] Move inserted include from detail -> documentation.

2020-04-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clangd/CodeComplete.cpp:1834 if (InsertInclude) -LSP.detail += "\n" + InsertInclude->Header; - LSP.documentation = Documentation; +

[PATCH] D79160: [AST] Preserve the type in RecoveryExprs for broken function calls.

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

[PATCH] D79160: [AST] Preserve the type in RecoveryExprs for broken function calls.

2020-05-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/lib/AST/ComputeDependence.cpp:491 + auto D = + toExprDependence(E->getType()->getDependence()) | ExprDependence::Error; for (auto *S : E->subExpressions()) sammccall wrote: > Dropping type-dependence seems

[PATCH] D84970: Adjust all existing tests.

2020-07-30 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. Herald added a subscriber: wuzish. DO NOT SUBMIT, enable the recovery-ast for C by default. Repository: rG LLVM Github Mono

[PATCH] D84919: [clangd] Be more explicit on testing the optional DefLoc in LocatedSymbol.

2020-07-31 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. hokein marked an inline comment as done. Closed by commit rG638f0cf565f2: [clangd] Be more explicit on testing the optional DefLoc in LocatedSymbol. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D85025: [RecoveryExpr]WIP: Support dependence in C-only codepath

2020-07-31 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added subscribers: cfe-commits, dang, arphaman, kbarton, nemanjai. Herald added a project: clang. hokein requested review of this revision. Herald added a subscriber: wuzish. This is a large patch containing all required changes, want early feedback. what does

[PATCH] D84811: [clangd] Add an option to exclude symbols outside of project root from index

2020-07-31 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/indexer/IndexerMain.cpp:70 SymbolCollector::Options Opts; +Opts.FileFilter = FileFilter; Opts.CountReferences = true; `FileFilter` seems more promising, but there are some FIXMEs ("u

[PATCH] D85028: [clangd] Support new/deleta operator in TargetFinder.

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

[PATCH] D85028: [clangd] Support new/deleta operator in TargetFinder.

2020-08-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 282509. hokein added a comment. address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85028/new/ https://reviews.llvm.org/D85028 Files: clang-tools-extra/clangd/FindTarget.cpp clang-tools-extra/cl

[PATCH] D85028: [clangd] Support new/deleta operator in TargetFinder.

2020-08-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. > please note that this might require special handling for go-to-def. as > go-to-def only jumps to canonical decl and in operator new's case the user > provided one might not be canonical, whereas the canonical one is likely > builtin without a source info. this is a go

[PATCH] D85077: [clang][Tooling] Optimize addTargetAndMode in case of invalid modes

2020-08-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/lib/Tooling/Tooling.cpp:264 + // No need to search for target args if we don't have a mode to insert. + bool AlreadyHasTarget = !TargetMode.TargetIsValid; bool AlreadyHasMode = false; While this is an optimizat

[PATCH] D85108: [clang] Include trailing-requires-clause in FunctionDecl's source range

2020-08-03 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. Comment at: clang/test/AST/ast-dump-concepts.cpp:28 + + // CHECK: FunctionTemplateDecl {{.*}} {{.*}} Foo + template could you add one more

[PATCH] D85077: [clang][Tooling] Optimize addTargetAndMode in case of invalid modes

2020-08-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/lib/Tooling/Tooling.cpp:264 + // No need to search for target args if we don't have a mode to insert. + bool AlreadyHasTarget = !TargetMode.TargetIsValid; bool AlreadyHasMode = false; kadircet wrote: > hokein w

[PATCH] D84136: [clang] Fix visitation of ConceptSpecializationExpr in constrained-parameter

2020-08-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a subscriber: rsmith. hokein added inline comments. Comment at: clang/include/clang/AST/RecursiveASTVisitor.h:1843 + if (const auto *TC = D->getTypeConstraint()) { +TRY_TO(TraverseStmt(TC->getImmediatelyDeclaredConstraint())); TRY_TO(TraverseConceptReferenc

[PATCH] D85124: [Concepts] Include the found concept decl when dumping the ConceptSpecializationExpr

2020-08-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: nridge. Herald added a project: clang. hokein requested review of this revision. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D85124 Files: clang/include/clang/AST/TextNodeDumper.h clang/lib/AST/TextNodeDumper.cpp cla

[PATCH] D85028: [clangd] Support new/delete operator in TargetFinder.

2020-08-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 282590. 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/D85028/new/ https://reviews.llvm.org/D85028 Files: clang-tools-extra/cla

[PATCH] D85028: [clangd] Support new/delete operator in TargetFinder.

2020-08-03 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 rG5191f70ab1f4: [clangd] Support new/deleta operator in TargetFinder. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D85124: [Concepts] Include the found concept decl when dumping the ConceptSpecializationExpr

2020-08-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 282906. hokein marked an inline comment as done. hokein added a comment. address comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85124/new/ https://reviews.llvm.org/D85124 Files: clang/include/clang/AS

[PATCH] D85124: [Concepts] Include the found concept decl when dumping the ConceptSpecializationExpr

2020-08-04 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 rG1c0a0dfa0236: [Concepts] Include the found concept decl when dumping the… (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-08-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 282916. hokein added a comment. address review comments: - treat contains-errors expression as being potentially constant; - handle the value-dependent expressions for EvaluateInPlace; - remove the bailing out for constructor initializers that contains errors;

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-08-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 282917. hokein added a comment. update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84637/new/ https://reviews.llvm.org/D84637 Files: clang/lib/AST/ExprConstant.cpp clang/test/SemaCXX/constexpr-function-re

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-08-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:4961 } +if (IS->getCond()->isValueDependent()) + return EvaluateDependentExpr(IS->getCond(), Info); The `if` stmt (the same to `while`,

[PATCH] D85282: [Concepts] Dump template arguments for immediately declared constraint.

2020-08-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: nridge. Herald added a subscriber: kristof.beyls. Herald added a project: clang. hokein requested review of this revision. The template arguments were dumped as part of the TemplateTypeParmDecl, which was incorrect. Repository: rG LLVM Git

[PATCH] D85272: [clangd] Semantic highlighting for dependent template name in template argument

2020-08-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:305 + break; +default:; +} nit: move the trailing `;` to a new line. Reposit

[PATCH] D85310: [clangd] Disable define out-of-line code action on templates

2020-08-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp:125 "Couldn't get range for function."); // Include template parameter list. if (auto *FTD = FD->getDescribedFunctionTemplate())

[PATCH] D85318: [clangd] Hide "swap if branch" tweak

2020-08-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: kadircet. Herald added subscribers: usaxena95, arphaman, jkorous. Herald added a project: clang. hokein requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. This tweak is more like a demo, and doesn't provide mu

<    12   13   14   15   16   17   18   19   20   21   >