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

Nathan Sidwell via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 23 14:36:15 PST 2022


urnathan 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))
----------------
serge-sans-paille wrote:
> 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.
np, you;ll see my later diffs (a)D117990 fixing this and (b) D118008 making it harder to make this mistake.  it'd be great if you could review those!


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

https://reviews.llvm.org/D117879



More information about the llvm-commits mailing list