[cfe-commits] r62416 - in /cfe/trunk/Driver: DiagChecker.cpp RewriteMacros.cpp

Chris Lattner sabre at nondot.org
Fri Jan 16 23:41:36 PST 2009


Author: lattner
Date: Sat Jan 17 01:41:36 2009
New Revision: 62416

URL: http://llvm.org/viewvc/llvm-project?rev=62416&view=rev
Log:
use simplified Lexer ctor.

Modified:
    cfe/trunk/Driver/DiagChecker.cpp
    cfe/trunk/Driver/RewriteMacros.cpp

Modified: cfe/trunk/Driver/DiagChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/DiagChecker.cpp?rev=62416&r1=62415&r2=62416&view=diff

==============================================================================
--- cfe/trunk/Driver/DiagChecker.cpp (original)
+++ cfe/trunk/Driver/DiagChecker.cpp Sat Jan 17 01:41:36 2009
@@ -118,12 +118,9 @@
   // 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);

Modified: cfe/trunk/Driver/RewriteMacros.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteMacros.cpp?rev=62416&r1=62415&r2=62416&view=diff

==============================================================================
--- cfe/trunk/Driver/RewriteMacros.cpp (original)
+++ cfe/trunk/Driver/RewriteMacros.cpp Sat Jan 17 01:41:36 2009
@@ -61,12 +61,10 @@
 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);





More information about the cfe-commits mailing list