HazardyKnusperkeks created this revision. HazardyKnusperkeks added reviewers: MyDeveloperDay, curdeius. HazardyKnusperkeks added a project: clang-format. HazardyKnusperkeks requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D95078 Files: clang/lib/Format/BreakableToken.cpp Index: clang/lib/Format/BreakableToken.cpp =================================================================== --- clang/lib/Format/BreakableToken.cpp +++ clang/lib/Format/BreakableToken.cpp @@ -25,7 +25,7 @@ namespace clang { namespace format { -static const char *const Blanks = " \t\v\f\r"; +static constexpr StringRef Blanks = " \t\v\f\r"; static bool IsBlank(char C) { switch (C) { case ' ': @@ -41,11 +41,11 @@ static StringRef getLineCommentIndentPrefix(StringRef Comment, const FormatStyle &Style) { - static const char *const KnownCStylePrefixes[] = {"///<", "//!<", "///", - "//", "//!", "//:"}; - static const char *const KnownTextProtoPrefixes[] = {"//", "#", "##", "###", - "####"}; - ArrayRef<const char *> KnownPrefixes(KnownCStylePrefixes); + static constexpr StringRef KnownCStylePrefixes[] = {"///<", "//!<", "///", + "//", "//!", "//:"}; + static constexpr StringRef KnownTextProtoPrefixes[] = {"//", "#", "##", "###", + "####"}; + ArrayRef<StringRef> KnownPrefixes(KnownCStylePrefixes); if (Style.Language == FormatStyle::LK_TextProto) KnownPrefixes = KnownTextProtoPrefixes;
Index: clang/lib/Format/BreakableToken.cpp =================================================================== --- clang/lib/Format/BreakableToken.cpp +++ clang/lib/Format/BreakableToken.cpp @@ -25,7 +25,7 @@ namespace clang { namespace format { -static const char *const Blanks = " \t\v\f\r"; +static constexpr StringRef Blanks = " \t\v\f\r"; static bool IsBlank(char C) { switch (C) { case ' ': @@ -41,11 +41,11 @@ static StringRef getLineCommentIndentPrefix(StringRef Comment, const FormatStyle &Style) { - static const char *const KnownCStylePrefixes[] = {"///<", "//!<", "///", - "//", "//!", "//:"}; - static const char *const KnownTextProtoPrefixes[] = {"//", "#", "##", "###", - "####"}; - ArrayRef<const char *> KnownPrefixes(KnownCStylePrefixes); + static constexpr StringRef KnownCStylePrefixes[] = {"///<", "//!<", "///", + "//", "//!", "//:"}; + static constexpr StringRef KnownTextProtoPrefixes[] = {"//", "#", "##", "###", + "####"}; + ArrayRef<StringRef> KnownPrefixes(KnownCStylePrefixes); if (Style.Language == FormatStyle::LK_TextProto) KnownPrefixes = KnownTextProtoPrefixes;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits