[PATCH] D19494: [ELF] Introduce --reproduce flag

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 25 16:03:35 PDT 2016


ruiu added inline comments.

================
Comment at: ELF/Driver.cpp:251
@@ +250,3 @@
+  if (EC) {
+    error("--reproduce: can't create directory.");
+    return;
----------------
Remove trailing `.` and pass EC to error. Then error will format the message for you by appending a colon and EC.message().

  error(EC, "--reproduce: can't create directory");

================
Comment at: ELF/Driver.cpp:262
@@ -226,1 +261,3 @@
+}
+
 void LinkerDriver::main(ArrayRef<const char *> ArgsArr) {
----------------
OK, but please do not emit trailing whitespace to the generated file.

================
Comment at: ELF/Driver.cpp:428-429
@@ -381,3 +427,4 @@
+  }
 }
 
 void LinkerDriver::createFiles(opt::InputArgList &Args) {
----------------
Looks like create_directories accepts IgnoreExisting parameter as the second parameter.

  std::error_code create_directories(const Twine &path,
                                     bool IgnoreExisting = true,
                                     perms Perms = owner_all | group_all);

You want to pass `false` then you can remove this code.


http://reviews.llvm.org/D19494





More information about the llvm-commits mailing list