[PATCH] D49158: [clang-tidy] Fixing segfault when there's no IdentifierInfo

2018-07-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D49158#1158327, @JonasToth wrote: > Is there a way to add a test, that would trigger the old segfault and show > that it does not happen anymore with this fix? +1, we should have a minimal test case for this fix, https://bugs.llvm.org/show_b

[PATCH] D49285: [clang-tidy] readability-inconsistent-declaration-parameter-name: accept approximate name matches.

2018-07-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp:96 +bool nameMatch(StringRef L, StringRef R) { + return L.contains_lower(R) || R.contains_lower(L); +} I have a concern that this is too general -- it

[PATCH] D49285: [clang-tidy] readability-inconsistent-declaration-parameter-name: accept approximate name matches.

2018-07-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. LGTM. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49285 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.

[PATCH] D68458: [clangd] Collect missing macro references.

2019-10-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: usaxena95, kadircet, arphaman, jkorous, MaskRay. Herald added a project: clang. Semantic highlghting is missing a few macro references. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/

[PATCH] D68459: [clang-rename] Fix a crash when renaming a class without definition.

2019-10-04 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/D68459 Files: clang/lib/Tooling/Refactoring/Rename/USRFindingAction.cpp clang/test/clang-rename/ForwardClassDecl.cpp Index: clang/

[PATCH] D68459: [clang-rename] Fix a crash when renaming a class without definition.

2019-10-04 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL373748: [clang-rename] Fix a crash when renaming a class without definition. (authored by hokein, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to co

[PATCH] D68564: [clangd] Catch an unchecked "Expected" in HeaderSourceSwitch.

2019-10-07 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. Also fixes a potential user-after-scope issue of "Path". Repository: rG LLVM Github Monorepo https://reviews.llvm.org

[PATCH] D67536: [WIP] [clangd] Add support for an inactive regions notification

2019-10-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D67536#1697533 , @nridge wrote: > How would one even measure the line length? `SourceManager` doesn't sem to > have a method like `getLineLength()` or similar. Yes, there is no existing API for that, I think you'd need to get

[PATCH] D68458: [clangd] Collect missing macro references.

2019-10-07 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL373889: [clangd] Collect missing macro references. (authored by hokein, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.ll

[PATCH] D68564: [clangd] Catch an unchecked "Expected" in HeaderSourceSwitch.

2019-10-07 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL373897: [clangd] Catch an unchecked "Expected" in HeaderSourceSwitch. (authored by hokein, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commi

[PATCH] D67901: [clangd] Improve semantic highlighting in dependent contexts (fixes #154)

2019-10-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:219 + bool VisitDependentNameTypeLoc(DependentNameTypeLoc L) { +addToken(L.getNameLoc(), HighlightingKind::DependentType); +return true; nridge wrote: > ilya-biry

[PATCH] D67901: [clangd] Improve semantic highlighting in dependent contexts (fixes #154)

2019-10-14 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 great now! Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:41 + if (auto *TD = dyn_cast(D)) { +if (auto *Templated = TD->getTemplatedDecl())

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-15 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: usaxena95, kadircet, arphaman, jkorous, MaskRay. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D68977 Files: clang-tools-extra/clangd/FindTarget.cpp

[PATCH] D68981: [clangd] Use our own relation kind.

2019-10-15 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. Move the RelationKind from Serialization.h to Relation.h. This patch doesn't introduce any breaking changes. Repository:

[PATCH] D68981: [clangd] Use our own relation kind.

2019-10-15 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 225017. hokein added a comment. update a style comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68981/new/ https://reviews.llvm.org/D68981 Files: clang-tools-extra/clangd/XRefs.cpp clang-tools-extra/c

[PATCH] D68981: [clangd] Use our own relation kind.

2019-10-15 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 225034. hokein marked 4 inline comments as done. hokein added a comment. Herald added subscribers: llvm-commits, dexonsmith. Herald added a project: LLVM. address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llv

[PATCH] D68981: [clangd] Use our own relation kind.

2019-10-15 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/index/MemIndex.h:72 // A map from (subject, predicate) pair to objects. - llvm::DenseMap, std::vector> + llvm::DenseMap, std::vector> Relations; kadircet wrote: > can we rather use `ui

[PATCH] D68981: [clangd] Use our own relation kind.

2019-10-15 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 225037. 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/D68981/new/ https://reviews.llvm.org/D68981 Files: clang-tools-extra/cla

[PATCH] D68981: [clangd] Use our own relation kind.

2019-10-15 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 225039. hokein added a comment. fix a missing static_cast. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68981/new/ https://reviews.llvm.org/D68981 Files: clang-tools-extra/clangd/XRefs.cpp clang-tools-extr

[PATCH] D68981: [clangd] Use our own relation kind.

2019-10-15 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 225041. hokein added a comment. more static_cast Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68981/new/ https://reviews.llvm.org/D68981 Files: clang-tools-extra/clangd/XRefs.cpp clang-tools-extra/clangd/i

[PATCH] D69094: [WIP] Add override relationship.

2019-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D69094 Files: clang-tools-extra/clangd/index/Relation.cpp clang-tools-extra/clangd/index/

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/FindTarget.cpp:415 Optional refInDecl(const Decl *D) { struct Visitor : ConstDeclVisitor { ilya-biryukov wrote: > This should return `SmallVector` now, some declarations can > have both dec

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 225398. hokein marked 14 inline comments as done. hokein added a comment. address comments: - remove the confusing IsDeclRef - use getQualifier from AST.h Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68977/new/

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/unittests/FindTargetTests.cpp:850 + "1: targets = {Foo::Foo}, decl\n" + "2: targets = {Foo::~Foo}, decl\n" + "3: targets = {Foo}\n" ilya-biryukov wrote: > Could we av

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 225420. hokein marked 6 inline comments as done. hokein added a comment. address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68977/new/ https://reviews.llvm.org/D68977 Files: clang-tools-extra/cla

[PATCH] D68981: [clangd] Use our own relation kind.

2019-10-17 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc8e3f43ab514: [clangd] Use our own relation kind. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68981/new/ https://reviews.llvm.org/D6

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/unittests/XRefsTests.cpp:2280 } -EXPECT_THAT(Names, UnorderedElementsAreArray(C.ExpectedDecls)); +EXPECT_THAT(Names, UnorderedElementsAreArray(C.ExpectedDecls)) +<< File.code(); --

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 225428. hokein marked 7 inline comments as done. hokein added a comment. address remaining nits. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68977/new/ https://reviews.llvm.org/D68977 Files: clang-tools-ext

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 225597. 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/D68977/new/ https://reviews.llvm.org/D68977 Files: clang-tools-extra/cla

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-18 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG65f61c0030c5: [clangd] Report declaration references in findExplicitReferences. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D68977?vs=225597&id=225601#toc Repository: rG L

[PATCH] D69241: [clangd] Handle the missing consturctor initializers in findExplicitReferences.

2019-10-21 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: usaxena95, kadircet, arphaman, jkorous, MaskRay. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D69241 Files: clang-tools-extra/clangd/FindTarget.cpp

[PATCH] D69263: [clangd] Implement cross-file rename.

2019-10-21 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added reviewers: ilya-biryukov, sammccall. Herald added subscribers: usaxena95, kadircet, arphaman, jkorous, MaskRay. Herald added a project: clang. This is the initial version. The cross-file rename is purely based on the index (plus a text-match verification)

[PATCH] D69263: [clangd] Implement cross-file rename.

2019-10-21 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. tests are missing, but the patch should be sufficient for initial review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69263/new/ https://reviews.llvm.org/D69263 ___ cfe-commit

[PATCH] D69241: [clangd] Handle the missing constructor initializers in findExplicitReferences.

2019-10-22 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 226013. hokein marked 2 inline comments as done. hokein added a comment. - fix some issues in the existing implementation; - add tests for base/delegating initializer; Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D69241: [clangd] Handle the missing constructor initializers in findExplicitReferences.

2019-10-22 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D69241#1716787 , @ilya-biryukov wrote: > NIT: there's a typo in the revision title: should be **constructor**, not > **consturctor** Done. Comment at: clang-tools-extra/clangd/unittests/FindTargetTests.cpp

[PATCH] D69266: [clangd] Define out-of-line availability checks

2019-10-22 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. the patch looks mostly good. would be interesting to see `apply` implementation. Comment at: clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp:29 +// criteria is met. +const FunctionDecl *getSelectedFunction(const SelectionTree::Node *SelNode) {

[PATCH] D69241: [clangd] Handle the missing constructor initializers in findExplicitReferences.

2019-10-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/FindTarget.cpp:677 if (const CXXCtorInitializer *CCI = N.get()) { - if (CCI->isBaseInitializer()) -return refInTypeLoc(CCI->getBaseClassLoc()); - ass

[PATCH] D69241: [clangd] Handle the missing constructor initializers in findExplicitReferences.

2019-10-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/FindTarget.cpp:677 if (const CXXCtorInitializer *CCI = N.get()) { - if (CCI->isBaseInitializer()) -return refInTypeLoc(CCI->getBaseClassLoc()); - ass

[PATCH] D69263: [clangd] Implement cross-file rename.

2019-10-22 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added a comment. Thanks for the comments. In D69263#1716760 , @ilya-biryukov wrote: > Another important concern is surfacing errors to the users: silently dropping > ranges for stale files is definitely no

[PATCH] D69298: [clangd] Define out-of-line initial apply logic

2019-10-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp:59 +// different location. Contains both function signature and body. +llvm::Optional moveFunctionDef(const FunctionDecl *FD) { + auto &SM = FD->getASTContext().getSourceManager(

[PATCH] D69266: [clangd] Define out-of-line availability checks

2019-10-23 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/unittests/TweakTests.cpp:1525 +TEST_F(DefineOutlineTest, TriggersOnFunctionDecl) { + // Not available unless in a header file. + EX

[PATCH] D69338: [clangd] Collect name references in the index.

2019-10-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added reviewers: kadircet, ilya-biryukov. Herald added subscribers: usaxena95, arphaman, jkorous, MaskRay. Herald added a project: clang. This is used for cross-file rename. When renaming a class, we expect to rename all related constructors/destructors. Repo

[PATCH] D69263: [clangd] Implement cross-file rename.

2019-10-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D69263#1718525 , @ilya-biryukov wrote: > In D69263#1717985 , @hokein wrote: > > > Thinking more about this -- we have a dynamic index (for all opened files) > > which is overlaid on a st

[PATCH] D69263: [clangd] Implement cross-file rename.

2019-10-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 226137. hokein marked 13 inline comments as done. hokein added a comment. - address comments; - add more FIXMEs; Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69263/new/ https://reviews.llvm.org/D69263 Files:

[PATCH] D69338: [clangd] Collect name references in the index.

2019-10-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 226139. 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/D69338/new/ https://reviews.llvm.org/D69338 Files: clang-tools-extra/clan

[PATCH] D69338: [clangd] Collect name references in the index.

2019-10-24 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGbf71e4fe0a68: [clangd] Collect name references in the index. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69338/new/ https://reviews.

[PATCH] D69241: [clangd] Handle the missing constructor initializers in findExplicitReferences.

2019-10-24 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG13fc899cdecc: [clangd] Handle the missing constructor initializers in findExplicitReferences. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.

[PATCH] D69266: [clangd] Define out-of-line availability checks

2019-10-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp:77 +Source = getSelectedFunction(Sel.ASTSelection.commonAncestor()); +if (!Source || !Source->isThisDeclarationADefinition()) + return false; I think

[PATCH] D69266: [clangd] Define out-of-line availability checks

2019-10-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/unittests/TweakTests.cpp:1556 + +[[void [[Bar::[[b^a^z() [[{ + return; Sorry for not spotting it earlier. Moving out-of-line methods is different than general functions, `void Bar::

[PATCH] D69263: [clangd] Implement cross-file rename.

2019-10-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 226414. hokein marked 5 inline comments as done. hokein added a comment. - simplify the code, addressing comments; - add unittests; Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69263/new/ https://reviews.llvm.o

[PATCH] D69263: [clangd] Implement cross-file rename.

2019-10-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D69263#1718525 , @ilya-biryukov wrote: > Not sure that holds. What if the file in question is being rebuilt right now? > We do not wait until all ASTs are built (and the dynamic index gets the new > results). > Open files act

[PATCH] D69431: [clangd] Do not highlight keywords in semantic highlighting

2019-10-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:233 - bool VisitTypeLoc(TypeLoc TL) { -if (auto K = kindForType(TL.getTypePtr())) as we are not visiting this base `TypeLoc` in this patch, will we miss any intere

[PATCH] D69431: [clangd] Do not highlight keywords in semantic highlighting

2019-10-28 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:233 - bool VisitTypeLoc(TypeLoc TL) { -if (auto K = kindForType(TL.getTypePtr())) il

[PATCH] D69263: [clangd] Implement cross-file rename.

2019-10-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/tool/ClangdMain.cpp:269 +cat(Features), +desc("Enable cross-file rename feature."), +init(false), ilya-biryukov wrote: > Could you document that the feature is highly experimental and

[PATCH] D69263: [clangd] Implement cross-file rename.

2019-10-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 226641. hokein marked 3 inline comments as done. hokein added a comment. address comments: - make the command-line flag hidden; - use the gtesting matcher; Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69263/new

[PATCH] D69506: [clangd] Add missing highlights for using decls.

2019-10-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: usaxena95, kadircet, arphaman, jkorous, MaskRay. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D69506 Files: clang-tools-extra/clangd/SemanticHighligh

[PATCH] D69266: [clangd] Define out-of-line availability checks

2019-10-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added inline comments. Comment at: clang-tools-extra/clangd/unittests/TweakTests.cpp:1549 + + // Not available for out-of-line metohds. + EXPECT_UNAVAILABLE(R"cpp( nit: metohds => methods. Repository: rG LLVM Github Mon

[PATCH] D69298: [clangd] Define out-of-line initial apply logic

2019-10-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp:55 + // Include template parameter list. + if (auto *FTD = FD->getDescribedFunctionTemplate()) +return FTD->getBeginLoc(); Could you confirm the code handle

[PATCH] D69511: [clangd] Do not report anonymous entities in findExplicitReferences

2019-10-28 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/FindTarget.cpp:454 + if (ND->getDeclName().isIdentifier() && + !ND->getDeclName().getAsIdentifierInfo()) +retur

[PATCH] D67536: [WIP] [clangd] Add support for an inactive regions notification

2019-10-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks, I'm fine with the current approach, feel free to add unittests. Comment at: clang-tools-extra/clangd/Protocol.h:1212 std::string Tokens; + /// Is the line in an inactive preprocessor branch? + bool IsInactive = false; could

[PATCH] D69506: [clangd] Add missing highlights for using decls.

2019-10-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 226673. hokein marked 3 inline comments as done. hokein added a comment. address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69506/new/ https://reviews.llvm.org/D69506 Files: clang-tools-extra/cla

[PATCH] D69506: [clangd] Add missing highlights for using decls.

2019-10-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:51 } + if (auto *UD = dyn_cast(D)) { +if (UD->shadow_size() == 0) ilya-biryukov wrote: > Could we reuse `kindForCandidateDecls` instead? > It's best to keep one wa

[PATCH] D69517: [clangd] Add a hidden tweak to dump symbol under the curosr.

2019-10-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: usaxena95, kadircet, arphaman, jkorous, MaskRay. Herald added a project: clang. This provides a convenient way to see the SymbolID/USR of the symbol, mainly for debugging purpose. Repository: rG LLV

[PATCH] D69506: [clangd] Add missing highlights for using decls.

2019-10-29 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 226851. hokein marked 2 inline comments as done. hokein added a comment. address remaining nits. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69506/new/ https://reviews.llvm.org/D69506 Files: clang-tools-ext

[PATCH] D69506: [clangd] Add missing highlights for using decls.

2019-10-29 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG94cd2f030324: [clangd] Add missing highlights for using decls. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69506/new/ https://review

[PATCH] D69517: [clangd] Add a hidden tweak to dump symbol under the cursor.

2019-10-29 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG80b0cdde0ffc: [clangd] Add a hidden tweak to dump symbol under the cursor. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69517/new/ ht

[PATCH] D80288: [AST] default implementation is possible for non-member functions in C++2a.

2020-05-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: clang. Make RAV not visit the default function decl by default. Also update some stale comments on FunctionDecl::isDefault. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D80288 Files: c

[PATCH] D80507: [clangd] Enable cross-file-rename by default.

2020-05-25 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. The cross-file rename feature is stable enough to enable it (has been rolled out internally for a few weeks).

[PATCH] D80508: [AST] Fix the source range for TagDecl if there is no matched } brace.

2020-05-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added reviewers: sammccall, akyrtzi. Herald added subscribers: usaxena95, kadircet, arphaman, dexonsmith, jkorous, ilya-biryukov. Herald added a project: clang. The AST is preserved when the TagDecl misses a } brace, but the source range seems incorrect (just

[PATCH] D80507: [clangd] Enable cross-file-rename by default.

2020-05-25 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG72c5ea1d73bb: [clangd] Enable cross-file-rename by default. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80507/new/ https://reviews.l

[PATCH] D80288: [AST] default implementation is possible for non-member functions in C++2a.

2020-05-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 265978. hokein added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80288/new/ https://reviews.llvm.org/D80288 Files: clang/include/clang/AST/Decl.h clang/include/clang/AST/Recur

[PATCH] D80288: [AST] default implementation is possible for non-member functions in C++2a.

2020-05-25 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG447ea9b4f5f5: [AST] default implementation is possible for non-member functions in C++20. (authored by MyDeveloperDay, committed by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTI

[PATCH] D80508: [AST] Fix the source range for TagDecl if there is no matched } brace.

2020-05-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clang/lib/AST/Decl.cpp:4129 SourceRange TagDecl::getSourceRange() const { - SourceLocation RBraceLoc = BraceRange.getEnd(); - SourceLocation E = RBraceLoc.isValid() ? RBraceLoc : getLocation();

[PATCH] D80221: [AST][RecoveryExpr] Make DeduceAutoType fail if the auto is deduced from recovery exprs.

2020-05-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Friendly ping, in case it is out of your radar -- this fixes another recovery-ast crash-on-invalid. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80221/new/ https://reviews.llvm.org/D80221 ___

[PATCH] D80733: [AST][RecoveryExpr] Build RecoveryExpr for "undef_var" cases.

2020-05-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a reviewer: jdoerfert. Herald added a subscriber: sstefan1. Herald added a project: clang. For a no-function-like unresolved expression, clang builds a TypoExpr for it, and tries to correct it afterwards. If the typo-co

[PATCH] D80221: [AST][RecoveryExpr] Make DeduceAutoType fail if the auto is deduced from recovery exprs.

2020-05-29 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG82bb57c11d8c: [AST][RecoveryExpr] Make DeduceAutoType fail if the auto is deduced from… (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D8

[PATCH] D80221: [AST][RecoveryExpr] Make DeduceAutoType fail if the auto is deduced from recovery exprs.

2020-05-29 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 267137. 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/D80221/new/ https://reviews.llvm.org/D80221 Files: clang/lib/Sema/SemaSt

[PATCH] D77178: [Analyzer][WebKit] NoUncountedMembersChecker

2020-06-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Hi, @jkorous Thanks for working on this analyzer check. Just give you some feedback on this check, it seems to trigger the assertion quite often (we noticed that internally there were a lot of crashes). you can easily reproduce it by running it a LLVM file, e.g. `./bin/

[PATCH] D80980: [AST] Fix a null initializer crash for InitListExpr

2020-06-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clang/lib/Sema/SemaInit.cpp:1640 expr = Result.getAs(); // FIXME: Why are we updating the syntactic init list? + if (!VerifyOnly && expr) I have the same question. but if y

[PATCH] D80980: [AST] Fix a null initializer crash for InitListExpr

2020-06-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: clang. hokein marked an inline comment as done. hokein added inline comments. Comment at: clang/lib/Sema/SemaInit.cpp:1640 expr = Result.getAs(); // FIXME: Why are we updating the synt

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

2020-06-02 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/D80981 Files: clang/lib/AST/ExprConstant.cpp clang/test/SemaCXX/constant-expression-cxx2a.cpp Index: clang/test/SemaCXX/constant-e

[PATCH] D80986: [clangd] Prototype for postfix completion.

2020-06-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. hokein edited the summary of this revision. This is a quick proof-of-concept demo for postfix completion. demo (ignore the wrong hig

[PATCH] D80980: [AST] Fix a null initializer crash for InitListExpr

2020-06-02 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG97b8dabba5c5: [AST] Fix a null initializer crash for InitListExpr (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80980/new/ https://rev

[PATCH] D80508: [AST] Fix the source range for TagDecl if there is no matched } brace.

2020-06-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clang/lib/AST/Decl.cpp:4129 SourceRange TagDecl::getSourceRange() const { - SourceLocation RBraceLoc = BraceRange.getEnd(); - SourceLocation E = RBraceLoc.isValid() ? RBraceLoc : getLocation();

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

2020-06-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added a subscriber: rsmith. hokein added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:4320 +if (!RD->hasDefinition()) + return APValue(); APValue Struct(APValue::UninitStruct(), RD->getNumBases(), --

[PATCH] D80733: [AST][RecoveryExpr] Build RecoveryExpr for "undef_var" cases.

2020-06-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 267873. hokein marked 3 inline comments as done. hokein added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80733/new/ https://reviews.llvm.org/D80733 Files: clang/lib/Sema/SemaEx

[PATCH] D80733: [AST][RecoveryExpr] Build RecoveryExpr for "undef_var" cases.

2020-06-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/lib/Sema/SemaExprCXX.cpp:8310 +// to RecoveryExpr. +// FIXME: we lose source locations for RecoveryExpr, as TypoExpr doesn't +// track source locations. sammccall wrote: > This seems reasonably straightf

[PATCH] D80733: [AST][RecoveryExpr] Build RecoveryExpr for "undef_var" cases.

2020-06-02 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG21ccc684ff4c: [AST][RecoveryExpr] Build RecoveryExpr for "undef_var" cases. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80733/new/ h

[PATCH] D81008: [AST] Record SourceLocation for TypoExpr.

2020-06-02 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/D81008 Files: clang/include/clang/AST/Expr.h clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaExprCXX.cpp clang/lib/Sema/SemaL

[PATCH] D81008: [AST] Record SourceLocation for TypoExpr.

2020-06-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 268068. hokein marked an inline comment as done. hokein added a comment. use a single location. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81008/new/ https://reviews.llvm.org/D81008 Files: clang/include/cl

[PATCH] D81008: [AST] Record SourceLocation for TypoExpr.

2020-06-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/include/clang/AST/Expr.h:6158 public: - TypoExpr(QualType T) : Expr(TypoExprClass, T, VK_LValue, OK_Ordinary) { + TypoExpr(QualType T, SourceLocation Start, SourceLocation End) + : Expr(TypoExprClass, T, VK_LValue, OK_Ordina

[PATCH] D81066: [clangd] Populate the parse options to CodeCompletion/SignatureHelp.

2020-06-03 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. A followup of D79938 . Repository: rG LLVM Github Monorepo https://revie

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

2020-06-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 268105. hokein added a comment. rebase to master. 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 cla

[PATCH] D81066: [clangd] Populate the parse options to CodeCompletion/SignatureHelp.

2020-06-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 268164. hokein marked 2 inline comments as done. hokein added a comment. Revert an accident change. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81066/new/ https://reviews.llvm.org/D81066 Files: clang-tools-

[PATCH] D81090: [AST][RecoveryExpr] Preserve the AST for invalid class constructions.

2020-06-03 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/D81090 Files: clang/lib/Sema/SemaExprCXX.cpp clang/test/AST/ast-dump-recovery.cpp Index: clang/test/AST/ast-dump-recovery.cpp

[PATCH] D81066: [clangd] Populate the parse options to CodeCompletion/SignatureHelp.

2020-06-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/CodeComplete.cpp:1108 + std::move(CI), + !CompletingInPreamble ? &(Input.Preamble.Preamble) : nullptr, std::move(ContentsBuffer), std::move(VFS), IgnoreDiags); sammccall wrote: >

[PATCH] D84032: [clang] Make clear Sema::CheckForConstantInitializer is for C-only codepath.

2020-07-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added reviewers: sammccall, efriedma. Herald added a project: clang. - add an assertion; - remove the changes introduced in https://github.com/llvm/llvm-project/commit/4a962f03bebef9e3c7d501580357a303638b2700, looks like clang can handle that well at the mome

[PATCH] D84032: [clang] Make clear Sema::CheckForConstantInitializer is for C-only codepath.

2020-07-17 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:11072 // rules there don't matter.) + assert(!getLangOpts().CPlusPlus || getLangOpts().OpenCLCPlusPlus); const Expr *Culprit; openCL for C++ is t

[PATCH] D84032: [clang] Make clear Sema::CheckForConstantInitializer is for C-only codepath.

2020-07-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein planned changes to this revision. hokein marked an inline comment as done. hokein added inline comments. Comment at: clang/test/SemaCXX/compound-literal.cpp:92 -// This doesn't necessarily need to be an error, but CodeGen can't handle it -// at the moment. -int PR17415 =

[PATCH] D84140: [clang] Set the error-bit for ill-formed semantic InitListExpr.

2020-07-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: kbobyrev, usaxena95, kadircet, arphaman, jkorous. Herald added a project: clang. When a semantic checking fails on a syntactic InitListExpr, we will get an ill-formed semantic InitListExpr (e.g. some inits

<    9   10   11   12   13   14   15   16   17   18   >