From d54646c69a5117cbeef35f5c3f0d546f4c6bf0e7 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Wed, 26 Aug 2026 00:50:21 +0800 Subject: [CodeGen] Implement reaching-def analysis printing --- backend/include/rcc/CodeGen/MIRPrinter.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'backend/include/rcc/CodeGen/MIRPrinter.h') diff --git a/backend/include/rcc/CodeGen/MIRPrinter.h b/backend/include/rcc/CodeGen/MIRPrinter.h index 4c20bed..ea58434 100644 --- a/backend/include/rcc/CodeGen/MIRPrinter.h +++ b/backend/include/rcc/CodeGen/MIRPrinter.h @@ -13,6 +13,8 @@ namespace rcc { class MachineFunction; class MachineBasicBlock; +class MachineInstr; +class MachineOperand; class TargetDescription; namespace mir { @@ -36,6 +38,17 @@ struct MIPrinterOptions final { const MIParserContext &Context = {}, MIPrinterOptions Options = {}); +[[nodiscard]] Expected +createMachineFunctionPrintContext(const MachineFunction &Function); +[[nodiscard]] Expected printMachineInstruction(const MachineInstr &Instruction, + const TargetDescription &Target, + const MIParserContext &Context, + MIPrinterOptions Options = {}); +[[nodiscard]] Expected printMachineOperand(const MachineOperand &Operand, + const TargetDescription &Target, + const MIParserContext &Context, + MIPrinterOptions Options = {}); + struct MIRDocumentPrinterOptions final { MIPrintMode Mode = MIPrintMode::Complete; bool EmitEmbeddedIR = true; -- cgit v1.2.3