summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-17 07:41:36 +0000
committerChris Lattner <sabre@nondot.org>2009-01-17 07:41:36 +0000
commit1db27eefa16cf4bcc4613b34f4e35faf1a0b09e3 (patch)
tree41e28089197d756d76426082c12d18406f26b070
parentf9291cf43c6047676d09bff2c0dd9fa6887e8143 (diff)
downloadbcm5719-llvm-1db27eefa16cf4bcc4613b34f4e35faf1a0b09e3.tar.gz
bcm5719-llvm-1db27eefa16cf4bcc4613b34f4e35faf1a0b09e3.zip
use simplified Lexer ctor.
llvm-svn: 62416
-rw-r--r--clang/Driver/DiagChecker.cpp5
-rw-r--r--clang/Driver/RewriteMacros.cpp4
2 files changed, 2 insertions, 7 deletions
diff --git a/clang/Driver/DiagChecker.cpp b/clang/Driver/DiagChecker.cpp
index 6503214c521..eeba859b19a 100644
--- a/clang/Driver/DiagChecker.cpp
+++ b/clang/Driver/DiagChecker.cpp
@@ -118,12 +118,9 @@ static void FindExpectedDiags(Preprocessor &PP,
// Create a raw lexer to pull all the comments out of the main file. We don't
// want to look in #include'd headers for expected-error strings.
FileID FID = PP.getSourceManager().getMainFileID();
- std::pair<const char*,const char*> File =
- PP.getSourceManager().getBufferData(FID);
// Create a lexer to lex all the tokens of the main file in raw mode.
- Lexer RawLex(PP.getSourceManager().getLocForStartOfFile(FID),
- PP.getLangOptions(), File.first, File.second);
+ Lexer RawLex(FID, PP.getSourceManager(), PP.getLangOptions());
// Return comments as tokens, this is how we find expected diagnostics.
RawLex.SetCommentRetentionState(true);
diff --git a/clang/Driver/RewriteMacros.cpp b/clang/Driver/RewriteMacros.cpp
index ecf4b416d8b..6ad4a7160cd 100644
--- a/clang/Driver/RewriteMacros.cpp
+++ b/clang/Driver/RewriteMacros.cpp
@@ -61,12 +61,10 @@ static const Token &GetNextRawTok(const std::vector<Token> &RawTokens,
static void LexRawTokensFromMainFile(Preprocessor &PP,
std::vector<Token> &RawTokens) {
SourceManager &SM = PP.getSourceManager();
- std::pair<const char*,const char*> File =SM.getBufferData(SM.getMainFileID());
// Create a lexer to lex all the tokens of the main file in raw mode. Even
// though it is in raw mode, it will not return comments.
- Lexer RawLex(SM.getLocForStartOfFile(SM.getMainFileID()),
- PP.getLangOptions(), File.first, File.second);
+ Lexer RawLex(SM.getMainFileID(), SM, PP.getLangOptions());
// Switch on comment lexing because we really do want them.
RawLex.SetCommentRetentionState(true);
OpenPOWER on IntegriCloud