[PATCH] D76291: [Support] Fix formatted_raw_ostream for UTF-8

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 17 13:29:47 PDT 2020


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/lib/Support/FormattedStream.cpp:64
+    } else {
+      // The first few bytes from the buffer will complete the code-point.
+      // Concatenate them and process their effect on the line ane column
----------------
s/code-point/code point/;


================
Comment at: llvm/lib/Support/FormattedStream.cpp:65
+      // The first few bytes from the buffer will complete the code-point.
+      // Concatenate them and process their effect on the line ane column
+      // numbers.
----------------
Typo: s/ane/and/;


================
Comment at: llvm/lib/Support/FormattedStream.cpp:81
+
+    // The buffer might end part way through a UTF-8 code point if it got
+    // flushed. If this happens we can't know the display width until we see the
----------------
s/UTF-8 code point/UTF-8 code unit sequence for a Unicode scalar value/;


================
Comment at: llvm/lib/Support/FormattedStream.cpp:82
+    // The buffer might end part way through a UTF-8 code point if it got
+    // flushed. If this happens we can't know the display width until we see the
+    // rest of the code point. Stash the bytes we do have, so that we can
----------------
Comma after "happens".


================
Comment at: llvm/lib/Support/FormattedStream.cpp:84
+    // rest of the code point. Stash the bytes we do have, so that we can
+    // reconstruct the whole code point later, even if the buffer is bsing
+    // flushed.
----------------
s/bsing/being/;


================
Comment at: llvm/unittests/Support/formatted_raw_ostream_test.cpp:54
+
+  // '\r sets coulmn to zero without changing line number
+  C << "foo\r";
----------------
s/coulmn/column/;


================
Comment at: llvm/unittests/Support/formatted_raw_ostream_test.cpp:72
+TEST(formatted_raw_ostreamTest, Test_Flush) {
+  // Flushing the buffer causes the charcters in the buffer to be scanned
+  // before the buffer is emptied, so line and column numbers will still be
----------------
s/charcters/characters/;


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76291





More information about the llvm-commits mailing list