[PATCH] D24820: Add -stats-file option

Matthias Braun via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 23 11:33:27 PDT 2016


MatzeB added inline comments.

================
Comment at: lib/Driver/Tools.cpp:6102
@@ +6101,3 @@
+        StatsFile.assign(Output.getFilename());
+        llvm::sys::path::remove_filename(StatsFile);
+      }
----------------
bruno wrote:
> Why removing StatsFile here? IIUC, at this point StatsFile is still the same as the output (if it's a file).
a) It behaves like -save-temps=obj (`clang -save-temps=obj foo.c -o bar` will give you foo.i, foo.o, ...;
b) This makes sense when you have multiple (`clang -save-stats=obj foo.c bar.c -o baz`) inputs for which you need multiple .stats filenames but you only have 1 output name 
c) It magically works for `-o -` as well



Repository:
  rL LLVM

https://reviews.llvm.org/D24820





More information about the cfe-commits mailing list