klimek accepted this revision. klimek added a comment. This revision is now accepted and ready to land.
lg ================ Comment at: include/clang/Format/Format.h:415 @@ +414,3 @@ + /// as the "main" include in both a.cc and a_test.cc. + std::string IncludeMainRegex; + ---------------- I'd probably call it MainIncludeRegex. ================ Comment at: lib/Format/Format.cpp:1967 @@ -1963,3 +1966,3 @@ if (FileStem.startswith(HeaderStem)) { - Category = 0; - MainIncludeFound = true; + llvm::Regex MainFileRegex( + (Twine(HeaderStem) + Style.IncludeMainRegex).str()); ---------------- Try to not set up the Regex in a loop. ================ Comment at: lib/Format/Format.cpp:1968 @@ +1967,3 @@ + llvm::Regex MainFileRegex( + (Twine(HeaderStem) + Style.IncludeMainRegex).str()); + if (MainFileRegex.match(FileStem)) { ---------------- Twine() shouldn't be needed. http://reviews.llvm.org/D18313 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits