aboutsummaryrefslogtreecommitdiff
path: root/backend/include/rcc/CodeGen/MIRPrinter.h
diff options
context:
space:
mode:
Diffstat (limited to 'backend/include/rcc/CodeGen/MIRPrinter.h')
-rw-r--r--backend/include/rcc/CodeGen/MIRPrinter.h13
1 files changed, 13 insertions, 0 deletions
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<MIParserContext>
+createMachineFunctionPrintContext(const MachineFunction &Function);
+[[nodiscard]] Expected<std::string> printMachineInstruction(const MachineInstr &Instruction,
+ const TargetDescription &Target,
+ const MIParserContext &Context,
+ MIPrinterOptions Options = {});
+[[nodiscard]] Expected<std::string> printMachineOperand(const MachineOperand &Operand,
+ const TargetDescription &Target,
+ const MIParserContext &Context,
+ MIPrinterOptions Options = {});
+
struct MIRDocumentPrinterOptions final {
MIPrintMode Mode = MIPrintMode::Complete;
bool EmitEmbeddedIR = true;