[cfe-commits] r59666 - in /cfe/trunk: include/clang/Lex/Preprocessor.h include/clang/Lex/PreprocessorLexer.h lib/Lex/Lexer.cpp lib/Lex/PPDirectives.cpp lib/Lex/PPLexerChange.cpp lib/Lex/PTHLexer.cpp lib/Lex/PreprocessorLexer.cpp

Chris Lattner clattner at apple.com
Wed Nov 19 23:24:13 PST 2008


On Nov 19, 2008, at 1:57 PM, Ted Kremenek wrote:
>
> URL: http://llvm.org/viewvc/llvm-project?rev=59666&view=rev
> Log:
> - Move static function IsNonPragmaNonMacroLexer into Preprocessor.h.
> - Add variants of IsNonPragmaNonMacroLexer to accept an  
> IncludeMacroStack entry
>  (simplifies some uses).
> - Use IsNonPragmaNonMacroLexer in Preprocessor::LookupFile.
> - Add 'FileID' to PreprocessorLexer, and have Preprocessor query  
> this fileid
>  when looking up the FileEntry for a file

Ok.

> +
> +
> +  static bool IsNonPragmaNonMacroLexer(const Lexer* L,
> +                                       const PreprocessorLexer* P) {

Please add doxygen comment to this and the others.

>
> +    if (L)
> +      return !L->isPragmaLexer();
> +    else
> +      return P != 0;

How about:
   return P != 0 || !L->isPragmaLexer(); ?

> +public:
> +  unsigned getFileID() const {
> +    assert(PP &&
> +      "PreprocessorLexer::getFileID() should only be used with a  
> Preprocessor");
> +    return FileID;
> +  }

Needs a doxygen comment.  Why the assert?

-Chris




More information about the cfe-commits mailing list