remove a sneaky version of Diag hiding in PreprocessorLexer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59858 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2008-11-22 06:20:42 +00:00
Родитель bcf6225ad6
Коммит 306fda76b0
4 изменённых файлов: 8 добавлений и 15 удалений

Просмотреть файл

@ -173,6 +173,7 @@ public:
/// Diag - Forwarding function for diagnostics. This translate a source
/// position in the current buffer into a SourceLocation object for rendering.
DiagnosticBuilder Diag(const char *Loc, unsigned DiagID) const;
DiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID) const;
/// getSourceLocation - Return a source location identifier for the specified
/// offset in the current file.

Просмотреть файл

@ -79,11 +79,6 @@ protected:
virtual void IndirectLex(Token& Result) = 0;
/// Diag - Forwarding function for diagnostics. This translate a source
/// position in the current buffer into a SourceLocation object for rendering.
void Diag(SourceLocation Loc, unsigned DiagID,
const std::string &Msg = std::string()) const;
//===--------------------------------------------------------------------===//
// #if directive handling.

Просмотреть файл

@ -313,6 +313,11 @@ DiagnosticBuilder Lexer::Diag(const char *Loc, unsigned DiagID) const {
return PP->Diag(getSourceLocation(Loc), DiagID);
}
DiagnosticBuilder Lexer::Diag(SourceLocation Loc, unsigned DiagID) const {
return PP->Diag(Loc, DiagID);
}
//===----------------------------------------------------------------------===//
// Trigraph and Escaped Newline Handling Code.
//===----------------------------------------------------------------------===//
@ -1148,9 +1153,7 @@ bool Lexer::LexEndOfFile(Token &Result, const char *CurPtr) {
// If we are in a #if directive, emit an error.
while (!ConditionalStack.empty()) {
PreprocessorLexer::Diag(ConditionalStack.back().IfLoc,
diag::err_pp_unterminated_conditional);
Diag(ConditionalStack.back().IfLoc, diag::err_pp_unterminated_conditional);
ConditionalStack.pop_back();
}

Просмотреть файл

@ -15,7 +15,6 @@
#include "clang/Lex/Preprocessor.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/SourceManager.h"
using namespace clang;
PreprocessorLexer::PreprocessorLexer(Preprocessor* pp, SourceLocation L)
@ -26,11 +25,6 @@ PreprocessorLexer::PreprocessorLexer(Preprocessor* pp, SourceLocation L)
PreprocessorLexer::~PreprocessorLexer() {}
void PreprocessorLexer::Diag(SourceLocation Loc, unsigned DiagID,
const std::string &Msg) const {
PP->Diag(Loc, DiagID) << Msg;
}
/// LexIncludeFilename - After the preprocessor has parsed a #include, lex and
/// (potentially) macro expand the filename.
void PreprocessorLexer::LexIncludeFilename(Token &FilenameTok) {
@ -49,5 +43,5 @@ void PreprocessorLexer::LexIncludeFilename(Token &FilenameTok) {
// No filename?
if (FilenameTok.is(tok::eom))
Diag(FilenameTok.getLocation(), diag::err_pp_expects_filename);
PP->Diag(FilenameTok.getLocation(), diag::err_pp_expects_filename);
}