This is an archive of the discontinued LLVM Phabricator instance.

[Demangle][Rust] Parse basic types
ClosedPublic

Authored by tmiasko on May 9 2021, 5:24 PM.

Diff Detail

Event Timeline

tmiasko created this revision.May 9 2021, 5:24 PM
tmiasko requested review of this revision.May 9 2021, 5:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 9 2021, 5:24 PM
dblaikie accepted this revision.May 9 2021, 7:19 PM

Looks good - maybe some patch reordering, maybe the generic rule is as good as the "M" or "Y" rule to test <type> - your call.

llvm/lib/Demangle/RustDemangle.cpp
119

Maybe it'd be more direct to implement/test type here (or with "Y" below) (or is there some even more direct production/reference to types?) rather than as parameters to generic types?

Then the generic type testing can include one simple nested type without using generic types as the means to test all the basic types?

236

Spec comment for <basic-type> (I realize it's not much more than the table of implementation - but when looking around for the <basic-type> rule, it'd be nice if it were written somewhere/here)

239–240
This revision is now accepted and ready to land.May 9 2021, 7:19 PM
tmiasko updated this revision to Diff 344011.May 10 2021, 2:59 AM
tmiasko marked 2 inline comments as done.

Address review comments

  • Add description of <basic-type> production from the specification.
  • Don't use else after a return.

The other rules seems equally good for testing <type> as <generic-arg> is, so I left this as is.

Could you commit this for me? Thanks.

This revision was automatically updated to reflect the committed changes.