diff options
Diffstat (limited to 'backend/include/rcc/CodeGen/GlobalISel/InstructionSelect.h')
| -rw-r--r-- | backend/include/rcc/CodeGen/GlobalISel/InstructionSelect.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/backend/include/rcc/CodeGen/GlobalISel/InstructionSelect.h b/backend/include/rcc/CodeGen/GlobalISel/InstructionSelect.h new file mode 100644 index 0000000..33b1659 --- /dev/null +++ b/backend/include/rcc/CodeGen/GlobalISel/InstructionSelect.h @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef RCC_CODEGEN_GLOBALISEL_INSTRUCTIONSELECT_H +#define RCC_CODEGEN_GLOBALISEL_INSTRUCTIONSELECT_H + +#include "rcc/CodeGen/GlobalISel/InstructionSelector.h" +#include "rcc/CodeGen/MachinePassManager.h" + +namespace rcc { + +class InstructionSelect final : public MachineFunctionPass { +public: + explicit InstructionSelect(const InstructionSelector *Info) : Info(Info) {} + explicit InstructionSelect(const InstructionSelector &Info) : Info(&Info) {} + + [[nodiscard]] const MachinePassContract &contract() const noexcept override; + [[nodiscard]] Expected<MachinePassResult> run(MachineFunction &Function, + const TargetDescription &Target, + MachineFunctionAnalysisManager &Analyses) override; + +private: + [[nodiscard]] Expected<MachinePassResult> + runImplementation(MachineFunction &Function, const TargetDescription &Target, + MachineFunctionAnalysisManager &Analyses); + + const InstructionSelector *Info; +}; + +} // namespace rcc + +#endif // RCC_CODEGEN_GLOBALISEL_INSTRUCTIONSELECT_H |
