diff options
author | George Karpenkov <ekarpenkov@apple.com> | 2018-01-23 19:28:52 +0000 |
---|---|---|
committer | George Karpenkov <ekarpenkov@apple.com> | 2018-01-23 19:28:52 +0000 |
commit | 4a190fe62f58eeaa9b996665e27b4d8898b140a7 (patch) | |
tree | d9e05be5794a782fb50682ae986cbd6b7b5fb06b /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 7c540debf27e725a6f50b88264b8f682827670e7 (diff) | |
download | bcm5719-llvm-4a190fe62f58eeaa9b996665e27b4d8898b140a7.tar.gz bcm5719-llvm-4a190fe62f58eeaa9b996665e27b4d8898b140a7.zip |
[analyzer] Show full analyzer invocation for reproducibility in HTML reports
Analyzing problems which appear in scan-build results can be very
difficult, as after the launch no exact invocation is stored, and it's
super-hard to launch the debugger.
With this patch, the exact analyzer invocation appears in the footer,
and can be copied to debug/check reproducibility/etc.
rdar://35980230
llvm-svn: 323245
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 74db7f89cf1..b107f65adf1 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -305,6 +305,14 @@ static bool ParseAnalyzerArgs(AnalyzerOptions &Opts, ArgList &Args, } } + llvm::raw_string_ostream os(Opts.FullCompilerInvocation); + for (unsigned i=0; i<Args.getNumInputArgStrings(); i++) { + if (i != 0) + os << " "; + os << Args.getArgString(i); + } + os.flush(); + return Success; } |