[PATCH] D134733: [clang-format][chore] transparent #include name regex

2022-09-30 Thread Konrad Wilhelm Kleine via Phabricator via cfe-commits
kwk updated this revision to Diff 464196. kwk added a comment. - Make include regex a static member and not a function - Run clang-format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134733/new/ https://reviews.llvm.org/D134733 Files: clang/inc

[PATCH] D134733: [clang-format][chore] transparent #include name regex

2022-09-29 Thread Konrad Wilhelm Kleine via Phabricator via cfe-commits
kwk added inline comments. Comment at: clang/lib/Tooling/Inclusions/HeaderIncludes.cpp:407 +const llvm::SmallVectorImpl &Matches) { + if (Matches.size() >= 3) { +return Matches[2]; MyDeveloperDay wrote: > kwk wrote: > > MyDeveloperDay wrote: > > > ‘>= 2’

[PATCH] D134733: [clang-format][chore] transparent #include name regex

2022-09-29 Thread Konrad Wilhelm Kleine via Phabricator via cfe-commits
kwk updated this revision to Diff 463786. kwk added a comment. - Remove ad-hoc instantiated IncludeRegex objects Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134733/new/ https://reviews.llvm.org/D134733 Files: clang/include/clang/Tooling/Inclus

[PATCH] D134733: [clang-format][chore] transparent #include name regex

2022-09-28 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a project: clang-format. owenpan added a comment. See D134852 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134733/new/ https://reviews.llvm.org/D134733

[PATCH] D134733: [clang-format][chore] transparent #include name regex

2022-09-28 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. While attempting to review this patch, I came to the conclusion that we should first clean up the `HeaderIncludes` class and Format.cpp a little. I will submit a patch for review ASAP. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.l

[PATCH] D134733: [clang-format][chore] transparent #include name regex

2022-09-28 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added inline comments. Comment at: clang/lib/Tooling/Inclusions/HeaderIncludes.cpp:407 +const llvm::SmallVectorImpl &Matches) { + if (Matches.size() >= 3) { +return Matches[2]; kwk wrote: > MyDeveloperDay wrote: > > ‘>= 2’ > @MyDeveloperDa

[PATCH] D134733: [clang-format][chore] transparent #include name regex

2022-09-28 Thread Konrad Wilhelm Kleine via Phabricator via cfe-commits
kwk added a comment. @MyDeveloperDay please see my potentially uneducated comments. Comment at: clang/lib/Tooling/Inclusions/HeaderIncludes.cpp:400 +llvm::Regex getCppIncludeRegex() { + static const char CppIncludeRegexPattern[] = + R"(^[\t\ ]*#[\t\ ]*(import|include)[^"<

[PATCH] D134733: [clang-format][chore] transparent #include name regex

2022-09-27 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added inline comments. Comment at: clang/lib/Tooling/Inclusions/HeaderIncludes.cpp:400 +llvm::Regex getCppIncludeRegex() { + static const char CppIncludeRegexPattern[] = + R"(^[\t\ ]*#[\t\ ]*(import|include)[^"<]*(["<][^">]*[">]))"; What if t

[PATCH] D134733: [clang-format][chore] transparent #include name regex

2022-09-27 Thread Konrad Wilhelm Kleine via Phabricator via cfe-commits
kwk created this revision. kwk added a reviewer: MyDeveloperDay. Herald added a project: All. kwk requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The foundation for this patch was done in: https://reviews.llvm.org/D121370. I wanted to "resc