aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/CodeGen/RegAllocBasic.h
diff options
context:
space:
mode:
Diffstat (limited to 'backend/lib/CodeGen/RegAllocBasic.h')
-rw-r--r--backend/lib/CodeGen/RegAllocBasic.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/backend/lib/CodeGen/RegAllocBasic.h b/backend/lib/CodeGen/RegAllocBasic.h
new file mode 100644
index 0000000..8a68f5f
--- /dev/null
+++ b/backend/lib/CodeGen/RegAllocBasic.h
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+// The private header has no stable include-root-relative guard name.
+// NOLINTNEXTLINE(llvm-header-guard)
+#ifndef RCC_LIB_CODEGEN_REGALLOCBASIC_H
+#define RCC_LIB_CODEGEN_REGALLOCBASIC_H
+
+#include "rcc/CodeGen/RegAllocCommon.h"
+#include "rcc/CodeGen/TargetRegisterAllocationInfo.h"
+
+namespace rcc {
+
+class BasicAllocatorPass final : public MachineFunctionPass {
+public:
+ explicit BasicAllocatorPass(const TargetRegisterAllocationInfo &Info,
+ RegisterAllocationOptions Options = {}) noexcept
+ : Info(&Info), Options(Options) {}
+
+ [[nodiscard]] const MachinePassContract &contract() const noexcept override;
+ [[nodiscard]] Expected<MachinePassResult> run(MachineFunction &Function,
+ const TargetDescription &Target,
+ MachineAnalysisManager &Analyses) override;
+
+private:
+ const TargetRegisterAllocationInfo *Info;
+ RegisterAllocationOptions Options;
+};
+
+} // namespace rcc
+
+#endif // RCC_LIB_CODEGEN_REGALLOCBASIC_H