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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323245
91177308-0d34-0410-b5e6-
96231b3b80d8
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;
}
}
+ 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;
}
color:#444444;
padding-right:2ex;
}
+
+/* Hidden text. */
+input.spoilerhider + label {
+ cursor: pointer;
+ text-decoration: underline;
+ display: block;
+}
+input.spoilerhider {
+ display: none;
+}
+input.spoilerhider ~ .spoiler {
+ overflow: hidden;
+ margin: 10px auto 0;
+ height: 0;
+ opacity: 0;
+}
+input.spoilerhider:checked + label + .spoiler{
+ height: auto;
+ opacity: 1;
+}
</style>
</head>
<body>)<<<";
<h3>Annotated Source Code</h3>
<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a>
to see keyboard shortcuts</p>
+<input type="checkbox" class="spoilerhider" id="showinvocation" />
+<label for="showinvocation" >Show analyzer invocation</label>
+<div class="spoiler">clang -cc1 )<<<";
+ os << html::EscapeText(AnalyzerOpts.FullCompilerInvocation);
+ os << R"<<<(
+</div>
<div id='tooltiphint' hidden="true">
<p>Keyboard shortcuts: </p>
<ul>
<a href="#" onclick="toggleHelp(); return false;">Close</a>
</div>
)<<<";
-
R.InsertTextBefore(SMgr.getLocForStartOfFile(FID), os.str());
}