[PATCH] D121370: [clang-format] SortIncludes should support "@import" lines in Objective-C

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 18 00:06:35 PDT 2022


owenpan added a comment.

Should we handle `#import` and `@import` for Object-C only so as to simply the regex for C++?



================
Comment at: clang/include/clang/Tooling/Inclusions/HeaderIncludes.h:136
+/// #include <foo.h>
+/// @include bar;
+/// #include "bar.h"
----------------
I think you meant `@import bar;`, which is valid in Objective-C only. So is `#import` btw.


================
Comment at: clang/include/clang/Tooling/Inclusions/HeaderIncludes.h:139-147
+llvm::Regex GetCppIncludeRegex();
+
+/// \returns the last match in the list of matches that is not empty.
+llvm::StringRef GetIncludeNameFromMatches(
+    const llvm::SmallVectorImpl<llvm::StringRef> &Matches);
+
+/// \returns the given include name and removes the following symbols from the
----------------
Function names should start with a lowercase letter.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121370



More information about the cfe-commits mailing list