]> granicus.if.org Git - clang/commitdiff
use simplified Lexer ctor.
authorChris Lattner <sabre@nondot.org>
Sat, 17 Jan 2009 07:41:36 +0000 (07:41 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 17 Jan 2009 07:41:36 +0000 (07:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62416 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/DiagChecker.cpp
Driver/RewriteMacros.cpp

index 6503214c521801969bf7514f313805f053a879e4..eeba859b19a0dceaedc8d1a876521644a09ccffc 100644 (file)
@@ -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);
index ecf4b416d8b5778f62e9877fcbe75cafd686b38d..6ad4a7160cdc3e0f225131ecba2d9be027c0ecfa 100644 (file)
@@ -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);