Author: Serge Pavlov
Date: 2020-11-17T15:16:09+07:00
New Revision: 9faedb2d7146d29bfd0f601e2a4a90b546cdaf04

URL: 
https://github.com/llvm/llvm-project/commit/9faedb2d7146d29bfd0f601e2a4a90b546cdaf04
DIFF: 
https://github.com/llvm/llvm-project/commit/9faedb2d7146d29bfd0f601e2a4a90b546cdaf04.diff

LOG: [Driver] Quote executable in reports generated by -fproc-stat-report

The option -fproc-stat-report=<file> makes driver to generate child
process resource comsumption report. In the report executable name was
not quoted and it made parsing the report more difficult. With this
change the executable name is surrounded by quotation marks.

Added: 
    

Modified: 
    clang/lib/Driver/Driver.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 5f4e7f271764..fb258197cfdd 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -3964,7 +3964,9 @@ void Driver::BuildJobs(Compilation &C) const {
         // CSV format.
         std::string Buffer;
         llvm::raw_string_ostream Out(Buffer);
-        Out << llvm::sys::path::filename(Cmd.getExecutable()) << ',';
+        llvm::sys::printArg(Out, 
llvm::sys::path::filename(Cmd.getExecutable()),
+                            /*Quote*/ true);
+        Out << ',';
         if (Cmd.getOutputFilenames().empty())
           Out << "\"\"";
         else


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to