djasper added inline comments.
================ Comment at: lib/Format/FormatTokenLexer.cpp:642 tok::pp_define) && - std::find(ForEachMacros.begin(), ForEachMacros.end(), - FormatTok->Tok.getIdentifierInfo()) != ForEachMacros.end()) { - FormatTok->Type = TT_ForEachMacro; + (it = std::find(Macros.begin(), Macros.end(), + FormatTok->Tok.getIdentifierInfo())) != Macros.end()) { ---------------- This does a binary search. Why aren't you implementing it with a hashtable? ================ Comment at: lib/Format/FormatTokenLexer.h:101 + + struct MacroInfo { + MacroInfo() : Identifier(NULL), TokType(TT_Unknown) {} ---------------- What does this class do and why do we need it? Describe it's purpose in a comment. ================ Comment at: lib/Format/FormatTokenLexer.h:102 + struct MacroInfo { + MacroInfo() : Identifier(NULL), TokType(TT_Unknown) {} + MacroInfo(IdentifierInfo *Identifier, TokenType TokType) ---------------- nullptr ================ Comment at: lib/Format/FormatTokenLexer.h:109 + + bool operator==(const MacroInfo &Other) const { + return Identifier == Other.Identifier; ---------------- Are all of these used? https://reviews.llvm.org/D33440 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits