[cfe-commits] r67705 - /cfe/trunk/lib/Lex/PPMacroExpansion.cpp

Chris Lattner sabre at nondot.org
Wed Mar 25 14:01:40 PDT 2009


Author: lattner
Date: Wed Mar 25 16:01:40 2009
New Revision: 67705

URL: http://llvm.org/viewvc/llvm-project?rev=67705&view=rev
Log:
remove some dead code.  ArgTokens can never be empty, because it is always 
terminated with an EOF token.  The condition it is trying to check for is
handled by this code above.

    // Empty arguments are standard in C99 and supported as an extension in
    // other modes.
    if (ArgTokens.empty() && !Features.C99)
      Diag(Tok, diag::ext_empty_fnmacro_arg);



Modified:
    cfe/trunk/lib/Lex/PPMacroExpansion.cpp

Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=67705&r1=67704&r2=67705&view=diff

==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Wed Mar 25 16:01:40 2009
@@ -390,15 +390,6 @@
       //   #define A(x, foo...) blah(a, ## foo) 
       //   #define A(x, ...) blah(a, ## __VA_ARGS__) 
       isVarargsElided = MI->getNumArgs() > 1;
-    } else if (MI->getNumArgs() == 1) {
-      // #define A(x)
-      //   A()
-      // is ok because it is an empty argument.
-      
-      // Empty arguments are standard in C99 and supported as an extension in
-      // other modes.
-      if (ArgTokens.empty() && !Features.C99)
-        Diag(Tok, diag::ext_empty_fnmacro_arg);
     } else {
       // Otherwise, emit the error.
       Diag(Tok, diag::err_too_few_args_in_macro_invoc);





More information about the cfe-commits mailing list