[Lldb-commits] [PATCH] D77843: [lldb/DataFormatters] Delete GetStringPrinterEscapingHelper

Vedant Kumar via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 17 14:05:08 PDT 2020


vsk marked 8 inline comments as done.
vsk added inline comments.


================
Comment at: lldb/source/DataFormatters/StringPrinter.cpp:173
+  unsigned escaped_len;
+  const unsigned max_buffer_size = 7;
+  uint8_t *data = new uint8_t[max_buffer_size];
----------------
shafik wrote:
> `constexpr`
Cool, I learned that only 'constexpr' guarantees that you have a compile-time constant. Fixed here and below.


================
Comment at: lldb/unittests/DataFormatter/StringPrinterTests.cpp:109
+  EXPECT_TRUE(matches({"\0", 1}, QUOTE("")));
+  EXPECT_TRUE(matches("\a", QUOTE("\\a")));
+  EXPECT_TRUE(matches("\b", QUOTE("\\u{8}")));
----------------
shafik wrote:
> We have [raw string literals](https://en.cppreference.com/w/cpp/language/string_literal) since C++11:
> 
> ```
> EXPECT_TRUE(matches("\a", R"("\a")"));
> ```
I personally find the current version much clearer, but can change this if others feel strongly.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77843





More information about the lldb-commits mailing list