diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-07-20 16:52:03 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-07-20 16:52:03 +0000 |
| commit | 77e9de50a112dc3f0bee0d43469db4bde47225c9 (patch) | |
| tree | 839d0805434f98057a49f5216acde711300486d3 /clang/Driver/TextDiagnosticPrinter.cpp | |
| parent | dc5c055fd1b31a0f5b11030a4e6ea5d6f2ed7d86 (diff) | |
| download | bcm5719-llvm-77e9de50a112dc3f0bee0d43469db4bde47225c9.tar.gz bcm5719-llvm-77e9de50a112dc3f0bee0d43469db4bde47225c9.zip | |
simplify the lexer ctor to take a SLoc instead of a sloc and a redundant buffer*.
llvm-svn: 40104
Diffstat (limited to 'clang/Driver/TextDiagnosticPrinter.cpp')
| -rw-r--r-- | clang/Driver/TextDiagnosticPrinter.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/clang/Driver/TextDiagnosticPrinter.cpp b/clang/Driver/TextDiagnosticPrinter.cpp index f37732c2416..87f33741b08 100644 --- a/clang/Driver/TextDiagnosticPrinter.cpp +++ b/clang/Driver/TextDiagnosticPrinter.cpp @@ -108,15 +108,11 @@ unsigned TextDiagnosticPrinter::GetTokenLength(SourceLocation Loc) { // TODO: this could be special cased for common tokens like identifiers, ')', // etc to make this faster, if it mattered. This could use // Lexer::isObviouslySimpleCharacter for example. - unsigned FileID = Loc.getFileID(); // Create a lexer starting at the beginning of this token. - Lexer TheLexer(SourceMgr.getBuffer(FileID), Loc, - *ThePreprocessor, StrData); - + Lexer TheLexer(Loc, *ThePreprocessor, StrData); LexerToken TheTok; TheLexer.LexRawToken(TheTok); - return TheTok.getLength(); } |

