[PATCH] D31176: [clang-rename] Support renaming qualified symbol

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 22 07:35:55 PDT 2017


hokein added inline comments.


================
Comment at: clang-rename/USRLocFinder.cpp:157
+    clang::NestedNameSpecifierLoc nested_name_specifier =
+        TL.castAs<clang::ElaboratedTypeLoc>().getQualifierLoc();
+    if (nested_name_specifier.getNestedNameSpecifier())
----------------
ioeric wrote:
> Is this cast always safe? 
Yes, because we have checked the type of the TL is an elaborated type. I have changed to `getAs` which makes the indication more explicitly.


================
Comment at: clang-rename/USRLocFinder.cpp:196
+
+class RenameLocFindingASTVisitor
+    : public clang::RecursiveASTVisitor<RenameLocFindingASTVisitor> {
----------------
ioeric wrote:
> ioeric wrote:
> > Comments.
> I think this visitor deserves a file of its own.
I'm not sure it is the right time to do it at the moment since it is in early stage. I'd keep it here. We can do it when needed. 


================
Comment at: clang-rename/USRLocFinder.cpp:368
+private:
+  bool IsTypeAliasWhichWillBeRenamedElsewhere(TypeLoc TL) const {
+    while (!TL.isNull()) {
----------------
ioeric wrote:
> Note this is not expected behavior for alias types which would always be skipped in this check.
Acked. Add a FIXME.


https://reviews.llvm.org/D31176





More information about the cfe-commits mailing list