[PATCH] D39290: [rename] Use SymbolOccurrence in RenameLocFinder.

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 25 09:37:13 PDT 2017


ioeric added a comment.

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?



================
Comment at: include/clang/Tooling/Refactoring/Rename/SymbolOccurrences.h:74
+    // The declaration in which the nested name is contained (can be nullptr).
+    const Decl *Context;
+    // The nested name being replaced (can be nullptr).
----------------
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.


https://reviews.llvm.org/D39290





More information about the cfe-commits mailing list