[PATCH] D117879: [demangler][NFC] Refactor some parsing

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 23 13:03:53 PST 2022


serge-sans-paille added inline comments.


================
Comment at: llvm/include/llvm/Demangle/StringView.h:45-49
+    size_t FindBegin = std::min(From, size());
     // Avoid calling memchr with nullptr.
-    if (From < size()) {
+    if (FindBegin < size()) {
       // Just forward to memchr, which is faster than a hand-rolled loop.
+      if (const void *P = ::memchr(First + FindBegin, C, size() - FindBegin))
----------------
urnathan wrote:
> ChuanqiXu wrote:
> > I thought the original logic is simpler.
> This change surprised me -- I did not intentionally make it.  These files in llvm/include/llvm/Demangle are synced from libcxxabi/src/demangle via that director's cp-to-llvm.sh script, which I applied.  It seems that commit 1f9e18b6565fd1bb69c4b649b9efd3467b3c7c7d
> Author: serge-sans-paille <sguelton at redhat.com>
> Date:   Thu Jan 20 11:21:47 2022 +0100
> 
>     [llvm] Remove (some) LLVMDemangle header dependencies
> 
> just jumped in between my recent resync and this diff.  Paging Serge!?
Sorry, I wasn't aware of the sync... (/me checks) and it's written in the header file, my bad.


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

https://reviews.llvm.org/D117879



More information about the llvm-commits mailing list