[PATCH] D63122: [llvm-strip] Error when using stdin twice

Alex Brachet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 10 23:31:28 PDT 2019


abrachet marked 3 inline comments as done.
abrachet added inline comments.


================
Comment at: llvm/test/tools/llvm-objcopy/ELF/same-file-strip.test:6
+
+# RUN: cp %p/Inputs/dynrel.elf dynrel.elf
+# RUN: llvm-strip dynrel.elf dynrel.elf 2>&1 \
----------------
I cp to file in the current directory because doing '%p/Inputs/dynrel.elf' on line 9 did not expand the %p.


================
Comment at: llvm/tools/llvm-objcopy/CopyConfig.cpp:805
   } else {
-    for (const char *Filename : Positional) {
+    StringSet<> InputFiles;
+    for (StringRef Filename : Positional) {
----------------
I don't know why this is the case but the compiler was not content with just StringSet and asked if I meant StringRef. But adding the <> fixed this. 


================
Comment at: llvm/tools/llvm-objcopy/llvm-objcopy.cpp:88
+  WithColor::warning(errs(), ToolName) << Message << "\n";
+  errs().flush();
+}
----------------
The objcopy::error functions explicitly flush errs, I don't know why though because it appears to be unbuffered, but I figured I would follow how the rest of the code does it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63122/new/

https://reviews.llvm.org/D63122





More information about the llvm-commits mailing list