aboutsummaryrefslogtreecommitdiff
path: root/backend/include/rcc/MIR/MIPrinter.h
diff options
context:
space:
mode:
Diffstat (limited to 'backend/include/rcc/MIR/MIPrinter.h')
-rw-r--r--backend/include/rcc/MIR/MIPrinter.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/backend/include/rcc/MIR/MIPrinter.h b/backend/include/rcc/MIR/MIPrinter.h
new file mode 100644
index 0000000..663859e
--- /dev/null
+++ b/backend/include/rcc/MIR/MIPrinter.h
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef RCC_MIR_MIPRINTER_H
+#define RCC_MIR_MIPRINTER_H
+
+#include "rcc/MIR/MIParser.h"
+#include "rcc/Support/Error.h"
+
+#include <string>
+
+namespace rcc {
+
+class MachineFunction;
+class TargetDescription;
+
+namespace mir {
+
+enum class MIPrintMode : unsigned char {
+ Complete,
+ Readable,
+};
+
+struct MIPrinterOptions final {
+ MIPrintMode Mode = MIPrintMode::Complete;
+};
+
+[[nodiscard]] Expected<std::string> printMachineFunctionBody(const MachineFunction &Function,
+ const TargetDescription &Target,
+ const MIParserContext &Context = {},
+ MIPrinterOptions Options = {});
+
+} // namespace mir
+} // namespace rcc
+
+#endif // RCC_MIR_MIPRINTER_H