Convert the lexer and start converting the PP over to using canonical Diag methods.
llvm-svn: 59511
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 3357791..2fe84c9 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -118,10 +118,15 @@
/// Diag - Forwarding function for diagnostics. This emits a diagnostic at
/// the specified Token's location, translating the token's start
/// position in the current buffer into a SourcePosition object for rendering.
-void Preprocessor::Diag(SourceLocation Loc, unsigned DiagID) {
- Diags.Report(getFullLoc(Loc), DiagID);
+DiagnosticInfo Preprocessor::Diag(SourceLocation Loc, unsigned DiagID) {
+ return Diags.Report(getFullLoc(Loc), DiagID);
}
+DiagnosticInfo Preprocessor::Diag(const Token &Tok, unsigned DiagID) {
+ return Diags.Report(getFullLoc(Tok.getLocation()), DiagID);
+}
+
+
void Preprocessor::Diag(SourceLocation Loc, unsigned DiagID,
const std::string &Msg) {
Diags.Report(getFullLoc(Loc), DiagID) << Msg;