From f1ca7d3e02e0fb4d5fa6ed56459a31776e82a605 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 27 Jan 2009 07:57:44 +0000 Subject: Introduce a new PresumedLoc class to represent the concept of a location as reported to the user and as manipulated by #line. This is what __FILE__, __INCLUDE_LEVEL__, diagnostics and other things should follow (but not dependency generation!). This patch also includes several cleanups along the way: - SourceLocation now has a dump method, and several other places that did similar things now use it. - I cleaned up some code in AnalysisConsumer, but it should probably be simplified further now that NamedDecl is better. - TextDiagnosticPrinter is now simplified and cleaned up a bit. This patch is a prerequisite for #line, but does not actually provide any #line functionality. llvm-svn: 63098 --- clang/lib/Lex/Preprocessor.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'clang/lib/Lex/Preprocessor.cpp') diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index e6bf1777a89..48fdd68ab9b 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -142,17 +142,7 @@ void Preprocessor::DumpToken(const Token &Tok, bool DumpFlags) const { } void Preprocessor::DumpLocation(SourceLocation Loc) const { - SourceLocation LogLoc = SourceMgr.getInstantiationLoc(Loc); - llvm::cerr << SourceMgr.getSourceName(LogLoc) << ':' - << SourceMgr.getLineNumber(LogLoc) << ':' - << SourceMgr.getColumnNumber(LogLoc); - - SourceLocation SpellingLoc = SourceMgr.getSpellingLoc(Loc); - if (SpellingLoc != LogLoc) { - llvm::cerr << " "; - } + Loc.dump(SourceMgr); } void Preprocessor::DumpMacro(const MacroInfo &MI) const { -- cgit v1.2.3