diff options
author | Justin Bogner <mail@justinbogner.com> | 2015-07-09 06:58:31 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2015-07-09 06:58:31 +0000 |
commit | ed9cbe015c1227980bf7be198835cf30a8de9285 (patch) | |
tree | e53e6043ee09c9f39eb2a7eaa7f38cfedf7c7829 /clang/lib/Driver/Job.cpp | |
parent | b41d2d3fa37bc0aa9a90ca759bdf4d872081587c (diff) | |
download | bcm5719-llvm-ed9cbe015c1227980bf7be198835cf30a8de9285.tar.gz bcm5719-llvm-ed9cbe015c1227980bf7be198835cf30a8de9285.zip |
Driver: Include the driver arguments in crash reports
Similarly to r231989, the driver arguments can be quite helpful in
diagnosing a crash.
llvm-svn: 241786
Diffstat (limited to 'clang/lib/Driver/Job.cpp')
-rw-r--r-- | clang/lib/Driver/Job.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Driver/Job.cpp b/clang/lib/Driver/Job.cpp index ac18e1eb56a..42bba56f5d4 100644 --- a/clang/lib/Driver/Job.cpp +++ b/clang/lib/Driver/Job.cpp @@ -71,7 +71,7 @@ static int skipArgs(const char *Flag, bool HaveCrashVFS) { return 0; } -static void PrintArg(raw_ostream &OS, const char *Arg, bool Quote) { +void Command::printArg(raw_ostream &OS, const char *Arg, bool Quote) { const bool Escape = std::strpbrk(Arg, "\"\\$"); if (!Quote && !Escape) { @@ -146,7 +146,7 @@ void Command::Print(raw_ostream &OS, const char *Terminator, bool Quote, CrashReportInfo *CrashInfo) const { // Always quote the exe. OS << ' '; - PrintArg(OS, Executable, /*Quote=*/true); + printArg(OS, Executable, /*Quote=*/true); llvm::ArrayRef<const char *> Args = Arguments; llvm::SmallVector<const char *, 128> ArgsRespFile; @@ -175,20 +175,20 @@ void Command::Print(raw_ostream &OS, const char *Terminator, bool Quote, // Replace the input file name with the crashinfo's file name. OS << ' '; StringRef ShortName = llvm::sys::path::filename(CrashInfo->Filename); - PrintArg(OS, ShortName.str().c_str(), Quote); + printArg(OS, ShortName.str().c_str(), Quote); continue; } } OS << ' '; - PrintArg(OS, Arg, Quote); + printArg(OS, Arg, Quote); } if (CrashInfo && HaveCrashVFS) { OS << ' '; - PrintArg(OS, "-ivfsoverlay", Quote); + printArg(OS, "-ivfsoverlay", Quote); OS << ' '; - PrintArg(OS, CrashInfo->VFSPath.str().c_str(), Quote); + printArg(OS, CrashInfo->VFSPath.str().c_str(), Quote); } if (ResponseFile != nullptr) { |