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

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 27 22:47:08 PDT 2022


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 this was overridable via the Style we could experiment with changing the regex


================
Comment at: clang/lib/Tooling/Inclusions/HeaderIncludes.cpp:407
+    const llvm::SmallVectorImpl<llvm::StringRef> &Matches) {
+  if (Matches.size() >= 3) {
+    return Matches[2];
----------------
‘>= 2’


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134733/new/

https://reviews.llvm.org/D134733



More information about the cfe-commits mailing list