[PATCH] D24914: [clang-rename] Do not print out error message upon encountering multiple replacements in the same SourceLocation.

Kirill Bobyrev via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 26 23:25:15 PDT 2016


omtcyfz updated this revision to Diff 72604.
omtcyfz marked 2 inline comments as done.
omtcyfz added a comment.

Address two comments from Alex.


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,14 @@
                << ":" << 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: As for clang-rename, adding a replacement fails IFF either the
+      // AST node has been matched multiple times (which shouldn't happen in
+      // reality, need to fix that). For now, just ignore the error as it
+      // doesn't mean clang-rename failure.
       if (Err)
-        llvm::errs() << "Renaming failed in " << Replace.getFilePath() << "! "
-                     << llvm::toString(std::move(Err)) << "\n";
+        llvm::consumeError(std::move(Err));
     }
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24914.72604.patch
Type: text/x-patch
Size: 1025 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160927/4d0d0dda/attachment.bin>


More information about the cfe-commits mailing list