[cfe-commits] r48076 - in /cfe/trunk: Lex/Preprocessor.cpp Lex/TokenLexer.cpp include/clang/Lex/Preprocessor.h

Chris Lattner sabre at nondot.org
Sat Mar 8 19:04:16 PST 2008


Author: lattner
Date: Sat Mar  8 21:04:16 2008
New Revision: 48076

URL: http://llvm.org/viewvc/llvm-project?rev=48076&view=rev
Log:
rename HandleEndOfMacro -> HandleEndOfTokenLexer

Modified:
    cfe/trunk/Lex/Preprocessor.cpp
    cfe/trunk/Lex/TokenLexer.cpp
    cfe/trunk/include/clang/Lex/Preprocessor.h

Modified: cfe/trunk/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Lex/Preprocessor.cpp?rev=48076&r1=48075&r2=48076&view=diff

==============================================================================
--- cfe/trunk/Lex/Preprocessor.cpp (original)
+++ cfe/trunk/Lex/Preprocessor.cpp Sat Mar  8 21:04:16 2008
@@ -1333,9 +1333,9 @@
   return true;
 }
 
-/// HandleEndOfMacro - This callback is invoked when the lexer hits the end of
-/// the current macro expansion or token stream expansion.
-bool Preprocessor::HandleEndOfMacro(Token &Result) {
+/// HandleEndOfTokenLexer - This callback is invoked when the current TokenLexer
+/// hits the end of its token stream.
+bool Preprocessor::HandleEndOfTokenLexer(Token &Result) {
   assert(CurTokenLexer && !CurLexer &&
          "Ending a macro when currently in a #include file!");
 
@@ -1382,7 +1382,7 @@
   // Okay, we either found and switched over the lexer, or we didn't find a
   // lexer.  In either case, finish off the macro the comment came from, getting
   // the next token.
-  if (!HandleEndOfMacro(Tok)) Lex(Tok);
+  if (!HandleEndOfTokenLexer(Tok)) Lex(Tok);
   
   // Discarding comments as long as we don't have EOF or EOM.  This 'comments
   // out' the rest of the line, including any tokens that came from other macros

Modified: cfe/trunk/Lex/TokenLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Lex/TokenLexer.cpp?rev=48076&r1=48075&r2=48076&view=diff

==============================================================================
--- cfe/trunk/Lex/TokenLexer.cpp (original)
+++ cfe/trunk/Lex/TokenLexer.cpp Sat Mar  8 21:04:16 2008
@@ -281,11 +281,11 @@
     // Pop this context off the preprocessors lexer stack and get the next
     // token.  This will delete "this" so remember the PP instance var.
     Preprocessor &PPCache = PP;
-    if (PP.HandleEndOfMacro(Tok))
+    if (PP.HandleEndOfTokenLexer(Tok))
       return;
 
-    // HandleEndOfMacro may not return a token.  If it doesn't, lex whatever is
-    // next.
+    // HandleEndOfTokenLexer may not return a token.  If it doesn't, lex
+    // whatever is next.
     return PPCache.Lex(Tok);
   }
   

Modified: cfe/trunk/include/clang/Lex/Preprocessor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=48076&r1=48075&r2=48076&view=diff

==============================================================================
--- cfe/trunk/include/clang/Lex/Preprocessor.h (original)
+++ cfe/trunk/include/clang/Lex/Preprocessor.h Sat Mar  8 21:04:16 2008
@@ -360,10 +360,9 @@
   /// client should call lex again.
   bool HandleEndOfFile(Token &Result, bool isEndOfMacro = false);
   
-  /// HandleEndOfMacro - This callback is invoked when the lexer hits the end of
-  /// the current macro line.  It returns true if Result is filled in with a
-  /// token, or false if Lex should be called again.
-  bool HandleEndOfMacro(Token &Result);
+  /// HandleEndOfTokenLexer - This callback is invoked when the current
+  /// TokenLexer hits the end of its token stream.
+  bool HandleEndOfTokenLexer(Token &Result);
   
   /// HandleDirective - This callback is invoked when the lexer sees a # token
   /// at the start of a line.  This consumes the directive, modifies the 





More information about the cfe-commits mailing list