[PATCH] D117879: [demangler][NFC] Refactor some parsing
Chuanqi Xu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 22 20:23:02 PST 2022
ChuanqiXu added inline comments.
================
Comment at: libcxxabi/src/demangle/ItaniumDemangle.h:2671-2673
+ bool IsStd = consumeIf("St");
+ if (IsStd)
+ consumeIf('L');
----------------
This looks equal to:
```
bool IsStd = consumeIf("St") || consumeIf('L');
```
================
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))
----------------
I thought the original logic is simpler.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117879/new/
https://reviews.llvm.org/D117879
More information about the llvm-commits
mailing list