[PATCH] D19737: Make --reproduce produce more reproducible logs.

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 29 16:52:49 PDT 2016


silvas added a comment.

In http://reviews.llvm.org/D19737#417445, @ruiu wrote:

> I could rewrite paths so that they are relative to FS_ROOT, but how would you handle thin archive files that contain pathnames rather than actual member files?


We could look inside them in this code for --reproduce or save some information in our InputFile structures. Don't we have a single point of truth for every file we open?


================
Comment at: ELF/DriverUtils.cpp:122
@@ +121,3 @@
+// okay because we don't want to have a complicated logic
+// for a debugging feature.
+static std::string quote(StringRef S) {
----------------
Clang generates response files for the linker and has been in production for some time. Can we share that code? I think the code we want to share is part of Command::writeResponseFile.

================
Comment at: ELF/DriverUtils.cpp:144
@@ +143,3 @@
+  SmallString<128> Path;
+  path::append(Path, Config->Reproduce, "invocation.txt");
+  std::error_code EC;
----------------
You may want to call this `invocation.rsp` since it is a response file (it obviously doesn't matter, but since we are changing the meaning from the previous `invocation.txt` it might help to avoid confusion).

================
Comment at: ELF/DriverUtils.cpp:152
@@ +151,3 @@
+  for (auto *Arg : Args) {
+    switch (Arg->getOption().getID()) {
+    case OPT_reproduce:
----------------
Nice reusing libOption for this! This is really nice!


http://reviews.llvm.org/D19737





More information about the llvm-commits mailing list