This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Query constructors in the index during rename.
ClosedPublic

Authored by hokein on Feb 11 2020, 7:44 AM.

Details

Summary

Though this is not needed when using clangd's own index, other indexes
(e.g. kythe) need it, as classes and their constructors are different
symbols, otherwise we will miss renaming constructors.

Diff Detail

Event Timeline

hokein created this revision.Feb 11 2020, 7:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 11 2020, 7:44 AM
kbobyrev added inline comments.Feb 12 2020, 5:17 AM
clang-tools-extra/clangd/refactor/Rename.cpp
326

What about desctructors? Should they always be handled separately?

clang-tools-extra/clangd/unittests/RenameTests.cpp
772

nit: I think most variables are not being modified here, so maybe const everywhere?

hokein updated this revision to Diff 244345.Feb 13 2020, 12:25 AM
hokein marked 3 inline comments as done.

address comments.

clang-tools-extra/clangd/refactor/Rename.cpp
326

destructors are fine, there is a type loc of Foo class in ~[[Foo]], so query the class id can find the reference.

kbobyrev accepted this revision.Feb 13 2020, 12:34 AM

Thanks!

This revision is now accepted and ready to land.Feb 13 2020, 12:34 AM
This revision was automatically updated to reflect the committed changes.