Index: include/clang/StaticAnalyzer/Core/AnalyzerOptions.h =================================================================== --- include/clang/StaticAnalyzer/Core/AnalyzerOptions.h +++ include/clang/StaticAnalyzer/Core/AnalyzerOptions.h @@ -139,6 +139,10 @@ AnalysisPurgeMode AnalysisPurgeOpt; std::string AnalyzeSpecificFunction; + + /// Store full compiler invocation for reproducible instructions in the + /// generated report. + std::string FullCompilerInvocation; /// \brief The maximum number of times the analyzer visits a block. unsigned maxBlockVisitOnPath; Index: lib/Frontend/CompilerInvocation.cpp =================================================================== --- lib/Frontend/CompilerInvocation.cpp +++ lib/Frontend/CompilerInvocation.cpp @@ -305,6 +305,14 @@ } } + llvm::raw_string_ostream os(Opts.FullCompilerInvocation); + for (unsigned i=0; i