summaryrefslogtreecommitdiffstats
path: root/clang/Driver/TextDiagnosticPrinter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/Driver/TextDiagnosticPrinter.cpp')
-rw-r--r--clang/Driver/TextDiagnosticPrinter.cpp6
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();
}
OpenPOWER on IntegriCloud