[PATCH] D111948: [Demangle] Add prepend functionality to OutputString

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 17 11:06:10 PDT 2021


dblaikie accepted this revision.
dblaikie added a comment.

Looks alright - guess some other boundary testing could be done (testing without anything in the buffer, testing when prepend causes the buffer to grow V when it's already big enough) but it's probably fine as-is.



================
Comment at: libcxxabi/src/demangle/Utility.h:102
+
+    if (Size != 0) {
+      grow(Size);
----------------
Could probably skip this. Falls out naturally from the implementation.


================
Comment at: libcxxabi/src/demangle/Utility.h:104-106
+      for (TempBuffer = (Buffer + CurrentPosition) - 1; TempBuffer >= Buffer; --TempBuffer) {
+        TempBuffer[Size] = TempBuffer[0];
+      }
----------------
Could use `memmove` for this?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111948



More information about the llvm-commits mailing list