- SMDiagnostic() : LineNo(0), ColumnNo(0), ShowLine(0) {}
- SMDiagnostic(SMLoc L, const std::string &FN, int Line, int Col,
+ // Null diagnostic.
+ SMDiagnostic() : SM(0), LineNo(0), ColumnNo(0), ShowLine(0) {}
+ // Diagnostic with no location (e.g. file not found, command line arg error).
+ SMDiagnostic(const std::string &filename, const std::string &Msg,
+ bool showline = true)
+ : SM(0), Loc(), Filename(filename), LineNo(-1), ColumnNo(-1),
+ Message(Msg), LineContents(""), ShowLine(showline) {}
+
+ // Diagnostic with a location.
+ SMDiagnostic(const SourceMgr &sm, SMLoc L, const std::string &FN,
+ int Line, int Col,