forked from OSchip/llvm-project
Add a Parser::Diag overload that can receive a custom string along with a SourceRange.
llvm-svn: 55283
This commit is contained in:
parent
404cd15fa5
commit
26da1f46e4
|
@ -245,6 +245,8 @@ private:
|
|||
bool Diag(SourceLocation Loc, unsigned DiagID,
|
||||
const std::string &Msg = std::string());
|
||||
bool Diag(SourceLocation Loc, unsigned DiagID, const SourceRange &R);
|
||||
bool Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg,
|
||||
SourceRange R1);
|
||||
bool Diag(const Token &Tok, unsigned DiagID,
|
||||
const std::string &M = std::string()) {
|
||||
return Diag(Tok.getLocation(), DiagID, M);
|
||||
|
|
|
@ -38,6 +38,12 @@ bool Parser::Diag(SourceLocation Loc, unsigned DiagID,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Parser::Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg,
|
||||
SourceRange Range) {
|
||||
Diags.Report(PP.getFullLoc(Loc), DiagID, &Msg, 1, &Range,1);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Parser::Diag(SourceLocation Loc, unsigned DiagID, const SourceRange &R) {
|
||||
Diags.Report(FullSourceLoc(Loc,PP.getSourceManager()), DiagID, 0, 0,
|
||||
&R, 1);
|
||||
|
|
Loading…
Reference in New Issue