[PATCH] D138323: [TableGen] RegisterInfo backend - Add abstraction layer between code generation logic and syntax output

Rot127 via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 24 07:02:03 PST 2022


Rot127 added a comment.

In D138323#3948239 <https://reviews.llvm.org/D138323#3948239>, @0x59616e wrote:

> Wouldn't this break the 'open-close principle' and 'Interface segregation principle' ?

Indeed it does. How about removing the `PrinterInterface` and make the `PrinterLLVM` the base class for all extensions (and marking their methods as virtual). Other `Printers` inherit from `PrinterLLVM` and override the methods needed?
This wouldn't be a big change, but also keep the printing logic in one place and not spread around the backends.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138323



More information about the llvm-commits mailing list