[PATCH] D95078: [clang-format] [NFC] Use some constexpr StringRef instead of const char*.
Björn Schäpers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 25 12:03:11 PST 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6cb288797122: [clang-format] [NFC] Use some constexpr StringRef (authored by HazardyKnusperkeks).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95078/new/
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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95078.319084.patch
Type: text/x-patch
Size: 1391 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210125/2e36598f/attachment.bin>
More information about the cfe-commits
mailing list