djasper added inline comments. ================ Comment at: lib/Format/Format.cpp:1441 @@ +1440,3 @@ +void skipComments(Lexer &Lex, Token &Tok) { + while (!Lex.LexFromRawLexer(Tok)) + if (Tok.isNot(tok::comment)) ---------------- I'd modify this to:
while (Tok.is(comment)) if (Lex.LexFromRawLexer(Tok)) return; So it skips tokens until it finds a non-comment token. ================ Comment at: lib/Format/Format.cpp:1452 @@ +1451,3 @@ + assert(Tok.is(tok::hash) && "If-directive must start with hash!"); + return !Lex.LexFromRawLexer(Tok) && Tok.is(tok::raw_identifier) && + Tok.getRawIdentifier() == Name && !Lex.LexFromRawLexer(Tok) && ---------------- Store this value in a bool and call another Lex.LexFromRawLexer afterwards. Both calls do this next. ================ Comment at: lib/Format/Format.cpp:1501 @@ +1500,3 @@ + bool HeaderGuardFound = false; + if (Tok.is(tok::hash) && isDirectiveWithName(Lex, "ifndef", Tok) && + !Lex.LexFromRawLexer(Tok)) { ---------------- Move the Tok.is(hash) check into isDirectiveWithName and replace the assert there. http://reviews.llvm.org/D20959 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits