omtcyfz updated this revision to Diff 72616.
omtcyfz added a comment.

Slightly change wording.


https://reviews.llvm.org/D24914

Files:
  clang-rename/RenamingAction.cpp

Index: clang-rename/RenamingAction.cpp
===================================================================
--- clang-rename/RenamingAction.cpp
+++ clang-rename/RenamingAction.cpp
@@ -68,12 +68,15 @@
                << ":" << FullLoc.getSpellingLineNumber() << ":"
                << FullLoc.getSpellingColumnNumber() << "\n";
       }
-      // FIXME: better error handling.
       tooling::Replacement Replace(SourceMgr, Loc, PrevNameLen, NewName);
       llvm::Error Err = FileToReplaces[Replace.getFilePath()].add(Replace);
+      // FIXME: An error might happen here if USRLocFinder finds the symbol
+      // twice or if the symbol happens to be in a header included multiple
+      // times independently. Such error doesn't mean clang-rename failure and
+      // therefore should be suppressed. However, more careful error handling
+      // might be better.
       if (Err)
-        llvm::errs() << "Renaming failed in " << Replace.getFilePath() << "! "
-                     << llvm::toString(std::move(Err)) << "\n";
+        llvm::consumeError(std::move(Err));
     }
   }
 


Index: clang-rename/RenamingAction.cpp
===================================================================
--- clang-rename/RenamingAction.cpp
+++ clang-rename/RenamingAction.cpp
@@ -68,12 +68,15 @@
                << ":" << FullLoc.getSpellingLineNumber() << ":"
                << FullLoc.getSpellingColumnNumber() << "\n";
       }
-      // FIXME: better error handling.
       tooling::Replacement Replace(SourceMgr, Loc, PrevNameLen, NewName);
       llvm::Error Err = FileToReplaces[Replace.getFilePath()].add(Replace);
+      // FIXME: An error might happen here if USRLocFinder finds the symbol
+      // twice or if the symbol happens to be in a header included multiple
+      // times independently. Such error doesn't mean clang-rename failure and
+      // therefore should be suppressed. However, more careful error handling
+      // might be better.
       if (Err)
-        llvm::errs() << "Renaming failed in " << Replace.getFilePath() << "! "
-                     << llvm::toString(std::move(Err)) << "\n";
+        llvm::consumeError(std::move(Err));
     }
   }
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to