[PATCH] D48951: [clang-move] ClangMoveTests: Remove dots in output paths

Simon Marchi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 5 07:58:11 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL336358: [clang-move] ClangMoveTests: Remove dots in output paths (authored by simark, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D48951

Files:
  clang-tools-extra/trunk/unittests/clang-move/ClangMoveTests.cpp


Index: clang-tools-extra/trunk/unittests/clang-move/ClangMoveTests.cpp
===================================================================
--- clang-tools-extra/trunk/unittests/clang-move/ClangMoveTests.cpp
+++ clang-tools-extra/trunk/unittests/clang-move/ClangMoveTests.cpp
@@ -239,8 +239,10 @@
   // The Key is file name, value is the new code after moving the class.
   std::map<std::string, std::string> Results;
   for (const auto &It : FileToReplacements) {
-    StringRef FilePath = It.first;
-    Results[FilePath] = Context.getRewrittenText(FileToFileID[FilePath]);
+    // The path may come out as "./foo.h", normalize to "foo.h".
+    SmallString<32> FilePath (It.first);
+    llvm::sys::path::remove_dots(FilePath);
+    Results[FilePath.str().str()] = Context.getRewrittenText(FileToFileID[FilePath]);
   }
   return Results;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48951.154243.patch
Type: text/x-patch
Size: 842 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180705/aacc869f/attachment.bin>


More information about the cfe-commits mailing list