[PATCH] D26734: [ELF] Don't replace path separators on *NIX

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 16 11:45:36 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL287143: [ELF] Don't replace path separators on *NIX. (authored by davide).

Changed prior to commit:
  https://reviews.llvm.org/D26734?vs=78231&id=78236#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D26734

Files:
  lld/trunk/lib/Core/Reproduce.cpp
  lld/trunk/test/ELF/reproduce-backslash.s


Index: lld/trunk/test/ELF/reproduce-backslash.s
===================================================================
--- lld/trunk/test/ELF/reproduce-backslash.s
+++ lld/trunk/test/ELF/reproduce-backslash.s
@@ -0,0 +1,9 @@
+# REQUIRES: x86, cpio, shell
+
+# Test that we don't erroneously replace \ with / on UNIX, as it's
+# legal for a filename to contain backslashes.
+# RUN: llvm-mc %s -o foo\\.o -filetype=obj -triple=x86_64-pc-linux
+# RUN: ld.lld foo\\.o --reproduce repro
+# RUN: cpio -t < repro.cpio | FileCheck %s
+
+# CHECK: repro/{{.*}}/foo\.o
Index: lld/trunk/lib/Core/Reproduce.cpp
===================================================================
--- lld/trunk/lib/Core/Reproduce.cpp
+++ lld/trunk/lib/Core/Reproduce.cpp
@@ -53,7 +53,9 @@
 // Converts path to use unix path separators so the cpio can be extracted on
 // both unix and windows.
 static void convertToUnixPathSeparator(SmallString<128> &Path) {
+#ifdef LLVM_ON_WIN32
   std::replace(Path.begin(), Path.end(), '\\', '/');
+#endif
 }
 
 void CpioFile::append(StringRef Path, StringRef Data) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26734.78236.patch
Type: text/x-patch
Size: 1072 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161116/4aad56e1/attachment.bin>


More information about the llvm-commits mailing list