This is an archive of the discontinued LLVM Phabricator instance.

[demangler][NFC] Tweak legacy uuidof handling
ClosedPublic

Authored by urnathan on Feb 11 2022, 6:27 AM.

Details

Reviewers
bruno
iains
ChuanqiXu
Group Reviewers
Restricted Project
Commits
rG880e87580a21: [demangler][NFC] Tweak legacy uuidof handling
Summary

We have to special-case 'u 8__uuidof [tz]' demangling for legacy support. That handling is a little duplicative.

  • It seems better to just push the single expected node.
  • We can also use 'consumeIf' rather than open-coding the peeking and increment.
  • We don't need the numLeft < 2 check, as if there are few than that other paths will end up with detecting the error.

FWIW This simplifies a future change adding operator precedence.

ETA: Removes about 150 bytes of code (x86_64)

Diff Detail

Event Timeline

urnathan requested review of this revision.Feb 11 2022, 6:27 AM
urnathan created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 11 2022, 6:27 AM
urnathan edited the summary of this revision. (Show Details)Feb 11 2022, 8:12 AM
ChuanqiXu accepted this revision.Feb 13 2022, 6:07 PM
ChuanqiXu added inline comments.
llvm/include/llvm/Demangle/ItaniumDemangle.h
5046–5047

We could move this one before the place it get used.

This revision is now accepted and ready to land.Feb 13 2022, 6:07 PM
urnathan marked an inline comment as done.Feb 14 2022, 4:02 AM
urnathan added inline comments.
llvm/include/llvm/Demangle/ItaniumDemangle.h
5046–5047

No, we need to record the current High Water Mark of the Names array.

This revision was landed with ongoing or failed builds.Feb 14 2022, 4:12 AM
This revision was automatically updated to reflect the committed changes.
urnathan marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2022, 4:12 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript