[PATCH] D26443: [ELF] - Use backward slashes inside response files

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 9 07:20:51 PST 2016


grimar added inline comments.


================
Comment at: lib/Core/Reproduce.cpp:96
   path::append(Res, path::relative_path(Abs));
+  std::replace(Res.begin(), Res.end(), '\\', '/');
 
----------------
grimar wrote:
> rafael wrote:
> > Exactly the same line is in CpioFile::append.  Is it dead with this change?
> I'll check, I did know about that one.
So no, it is not dead.

Current line is responsible for converting slashes in lines of response.txt file.
CpioFile::append()'s line converts the archive filename.

I thought about placing them together in CpioFile::append:
```
  // Use unix path separators so the cpio can be extracted on both unix and
  // windows.
  std::replace(Fullpath.begin(), Fullpath.end(), '\\', '/');
  std::replace(Data.begin(), Data.end(), '\\', '/');
```

But that probably not good thing to do because in that way slashes will be converted for all responce file and not only for path lines, what can change the original invocation result line.
Also it seems convinent that relativeToRoot() just always returns fixed path.



https://reviews.llvm.org/D26443





More information about the llvm-commits mailing list