[PATCH] D98994: NFC. Refactored DIPrinter for better support of new print styles.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 3 19:21:49 PDT 2021


dblaikie added inline comments.


================
Comment at: llvm/include/llvm/DebugInfo/Symbolize/DIPrinter.h:34-35
+  uint64_t Address = 0;
+  Request(StringRef ModuleName, uint64_t Address)
+      : ModuleName(ModuleName), Address(Address){};
+};
----------------
aorlov wrote:
> dblaikie wrote:
> > I probably wouldn't bother with a ctor here - uses can use braced init to construct it with a similar amount of syntax.
> I have removed any streams from DIPrinter. Now it is a clean interface.
> Note we don't need stderr in JSONPrinter. 
> And any other printer might not use the stdout and/or stderr at all.
> But I kept OS and ES in PlainPrinterBase ctor. 
> I don't see how to gracefully use braced init of PlainPrinterBase.
Sorry, I don't think my suggestion has anything to do with OS and ES.

I mean remove the Request ctor, then later on where there's currently `Printer.print(Request(ModuleName, Address), *ResOrErr);` it can be replaced with `Printer.print({ModuleName, Address}, *ResOrErr);`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98994



More information about the llvm-commits mailing list