This is an archive of the discontinued LLVM Phabricator instance.

[Demangle][Rust] Parse dyn-trait
ClosedPublic

Authored by tmiasko on May 29 2021, 9:53 AM.

Details

Diff Detail

Event Timeline

tmiasko created this revision.May 29 2021, 9:53 AM
tmiasko requested review of this revision.May 29 2021, 9:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 29 2021, 9:53 AM
dblaikie accepted this revision.Jun 1 2021, 4:25 PM

Looks good, thanks!

llvm/lib/Demangle/RustDemangle.cpp
548–560

This could be:

bool First = true;
while (!Error && !consumeIf('E'))
  if (First)
    print(" + ");
  First = false; // this could go inside the `if` above, or not - whichever seems more readable
  ...

Avoiding the increment on every iteration - I guess it'll probably optimize down to the same anyway, hopefully. So up to you if you reckon that might be more readable.

This revision is now accepted and ready to land.Jun 1 2021, 4:25 PM
tmiasko updated this revision to Diff 349191.Jun 2 2021, 1:15 AM
tmiasko retitled this revision from [Rust][Demangle] Parse dyn-trait to [Demangle][Rust] Parse dyn-trait.

Rebase

This revision was landed with ongoing or failed builds.Jun 7 2021, 9:25 AM
This revision was automatically updated to reflect the committed changes.