owenpan added inline comments.
================ Comment at: clang/lib/Tooling/Inclusions/HeaderIncludes.cpp:176-188 const char IncludeRegexPattern[] = - R"(^[\t\ ]*#[\t\ ]*(import|include)[^"<]*(["<][^">]*[">]))"; + R"(^[\t\ ]*[@#][\t\ ]*(import|include)([^"]*("[^"]+")|[^<]*(<[^>]+>)|[\t\ ]*([^;]+;)))"; + +// Returns the last match group in the above regex (IncludeRegexPattern) that +// is not empty. +StringRef getIncludeNameFromMatches(const SmallVectorImpl<StringRef> &Matches) { + for (int i = Matches.size() - 1; i > 0; i--) { ---------------- owenpan wrote: > If these are the same as in `Format.cpp` above, we should move the > definitions to `HeaderIncludes.h`. > If these are the same as in `Format.cpp` above, we should move the > definitions to `HeaderIncludes.h`. I meant we should remove the definitions from `Format.cpp` and add the declarations to `HeaderIncludes.h`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121370/new/ https://reviews.llvm.org/D121370 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits