[cfe-commits] r38695 - in /cfe/cfe/trunk/include/clang/Lex: MacroExpander.h Preprocessor.h

sabre at cs.uiuc.edu sabre at cs.uiuc.edu
Wed Jul 11 09:23:53 PDT 2007


Author: sabre
Date: Wed Jul 11 11:23:53 2007
New Revision: 38695

URL: http://llvm.org/viewvc/llvm-project?rev=38695&view=rev
Log:
Implement scanning-for-( more correctly.  This implements
test/Preprocessor/macro_fn_lparen_scan.c, but is not yet complete.

Modified:
    cfe/cfe/trunk/include/clang/Lex/MacroExpander.h
    cfe/cfe/trunk/include/clang/Lex/Preprocessor.h

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

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/MacroExpander.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/MacroExpander.h Wed Jul 11 11:23:53 2007
@@ -82,6 +82,13 @@
     delete FormalArgs;
   }
   
+  /// NextTokenIsKnownNotLParen - If the next token lexed will pop this macro
+  /// off the expansion stack, return false and set RanOffEnd to true.
+  /// Otherwise, return true if we know for sure that the next token returned
+  /// will not be a '(' token.  Return false if it is a '(' token or if we are
+  /// not sure.
+  bool NextTokenIsKnownNotLParen(bool &RanOffEnd) const;
+  
   MacroInfo &getMacro() const { return Macro; }
 
   /// Lex - Lex and return a token from this macro stream.

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

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/Preprocessor.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/Preprocessor.h Wed Jul 11 11:23:53 2007
@@ -467,6 +467,11 @@
   /// the macro should not be expanded return true, otherwise return false.
   bool HandleMacroExpandedIdentifier(LexerToken &Tok, MacroInfo *MI);
   
+  /// isNextPPTokenLParen - Determine whether the next preprocessor token to be
+  /// lexed is a '('.  If so, consume the token and return true, if not, this
+  /// method should have no observable side-effect on the lexed tokens.
+  bool isNextPPTokenLParen();
+  
   /// ReadFunctionLikeMacroFormalArgs - After reading "MACRO(", this method is
   /// invoked to read all of the formal arguments specified for the macro
   /// invocation.  This returns null on error.





More information about the cfe-commits mailing list