[PATCH] D102581: [Demangle][Rust] Parse function signatures

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 16 10:52:32 PDT 2021


dblaikie added inline comments.


================
Comment at: llvm/lib/Demangle/RustDemangle.cpp:506-513
+      size_t Start = Output.getCurrentPosition();
+      print(Ident.Name);
+      size_t End = Output.getCurrentPosition();
+      // When mangling ABI string, the "-" is replaced with "_".
+      char *Buffer = Output.getBuffer();
+      for (size_t I = Start; I != End; ++I)
+        if (Buffer[I] == '_')
----------------
Rather than using print and going back to modify the data - I think it might be nicer if this re-implemented print instead (it's simple enough -  the error check and !Print check, seem OK). It does mean one more place printing things - but this loop/manipulation of the buffer is akin to "printing" something, and in a more surprising way.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102581



More information about the llvm-commits mailing list