aboutsummaryrefslogtreecommitdiff
path: root/backend/include/rcc/MIR
diff options
context:
space:
mode:
Diffstat (limited to 'backend/include/rcc/MIR')
-rw-r--r--backend/include/rcc/MIR/ReachingDefPrinter.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/backend/include/rcc/MIR/ReachingDefPrinter.h b/backend/include/rcc/MIR/ReachingDefPrinter.h
new file mode 100644
index 0000000..8b4d1e0
--- /dev/null
+++ b/backend/include/rcc/MIR/ReachingDefPrinter.h
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef RCC_MIR_REACHINGDEFPRINTER_H
+#define RCC_MIR_REACHINGDEFPRINTER_H
+
+#include "rcc/CodeGen/MachinePassManager.h"
+
+#include <string_view>
+
+namespace rcc::mir {
+
+class ReachingDefPrinterPass final : public MachineFunctionPass {
+public:
+ [[nodiscard]] static constexpr std::string_view name() noexcept {
+ return "print<reaching-def>";
+ }
+
+ [[nodiscard]] const MachinePassContract &contract() const noexcept override;
+ [[nodiscard]] Expected<MachinePassResult> run(MachineFunction &Function,
+ const TargetDescription &Target,
+ MachineFunctionAnalysisManager &Analyses) override;
+};
+
+} // namespace rcc::mir
+
+#endif // RCC_MIR_REACHINGDEFPRINTER_H