This is an archive of the discontinued LLVM Phabricator instance.

[rename] Use SymbolOccurrence in RenameLocFinder.
AbandonedPublic

Authored by hokein on Oct 25 2017, 8:18 AM.

Details

Reviewers
ioeric
arphaman
Summary

This is first step to integrate qualified rename into clang-refactor.

Also a few changes to SymbolOccurrence:

  • add more information to SymbolOccurrence
  • remove the way of using SourceLocation as the array size

Event Timeline

hokein created this revision.Oct 25 2017, 8:18 AM
ioeric edited edge metadata.Oct 25 2017, 9:37 AM

Could you elaborate on the intention of this change? Is the intention of having more information in SymbolOccurrence to benefit users of the rename library or to simplify the internal implementation?

include/clang/Tooling/Refactoring/Rename/SymbolOccurrences.h
74

A SymbolOccurrence is likely to out-live an AST (e.g. when used in clang-refactor or serialized to files), so it might not be safe to store references to ASTs here. If we really want AST information in the SymbolOccurrence, we could probably derive from it and use only internally. But it doesn't make sense to pass AST references out to users.

hokein abandoned this revision.Oct 27 2017, 4:04 AM
hokein added inline comments.
include/clang/Tooling/Refactoring/Rename/SymbolOccurrences.h
74

Yeah, right. It is not a good idea to add AST information in the SymbolOccurrence as it is out range of Rule. On the second thought, we don't need to add this information. Let's close this revision.