bool ShowLocation;
bool PrintRangeInfo;
bool PrintDiagnosticOption;
+ bool PrintFixItInfo;
public:
TextDiagnosticPrinter(llvm::raw_ostream &os,
bool showColumn = true,
bool caretDiagnistics = true, bool showLocation = true,
bool printRangeInfo = true,
- bool printDiagnosticOption = true)
+ bool printDiagnosticOption = true,
+ bool printFixItInfo = true)
: OS(os), LangOpts(0),
LastCaretDiagnosticWasNote(false), ShowColumn(showColumn),
CaretDiagnostics(caretDiagnistics), ShowLocation(showLocation),
PrintRangeInfo(printRangeInfo),
- PrintDiagnosticOption(printDiagnosticOption) {}
+ PrintDiagnosticOption(printDiagnosticOption),
+ PrintFixItInfo(printFixItInfo) {}
void setLangOptions(const LangOptions *LO) {
LangOpts = LO;
OS << SourceLine << '\n';
OS << CaretLine << '\n';
- if (NumHints) {
+ if (NumHints && PrintFixItInfo) {
std::string InsertionLine;
- for (const CodeModificationHint *Hint = Hints,
- *LastHint = Hints + NumHints;
+ for (const CodeModificationHint *Hint = Hints, *LastHint = Hints + NumHints;
Hint != LastHint; ++Hint) {
if (Hint->InsertionLoc.isValid()) {
// We have an insertion hint. Determine whether the inserted
llvm::cl::desc("Do not include source line and caret with"
" diagnostics"));
+static llvm::cl::opt<bool>
+NoDiagnosticsFixIt("fno-diagnostics-fixit-info",
+ llvm::cl::desc("Do not include fixit information in"
+ " diagnostics"));
+
static llvm::cl::opt<bool>
PrintSourceRangeInfo("fprint-source-range-info",
llvm::cl::desc("Print source range spans in numeric form"));
!NoCaretDiagnostics,
!NoShowLocation,
PrintSourceRangeInfo,
- PrintDiagnosticOption));
+ PrintDiagnosticOption,
+ !NoDiagnosticsFixIt));
}
virtual void setLangOptions(const LangOptions *LO) {
!NoCaretDiagnostics,
!NoShowLocation,
PrintSourceRangeInfo,
- PrintDiagnosticOption));
+ PrintDiagnosticOption,
+ !NoDiagnosticsFixIt));
} else {
DiagClient.reset(CreateHTMLDiagnosticClient(HTMLDiag));
}