diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-09 13:23:48 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-09 13:23:48 +0800 |
| commit | da8bc76b4bf7d1a7b025d6c8ef5809551467dcc7 (patch) | |
| tree | 3b64eb08cd6376deceef2d7bac20eea5ce4de184 /backend/include/rcc/CodeGen/PrologueEpilogueInsertion.h | |
| parent | e5fdceb9b869f010a2a75638fd38aaf1867f3008 (diff) | |
| download | rcc-project-da8bc76b4bf7d1a7b025d6c8ef5809551467dcc7.tar.gz rcc-project-da8bc76b4bf7d1a7b025d6c8ef5809551467dcc7.tar.xz | |
[CodeGen] Implement RV64GC frame lowering
Diffstat (limited to 'backend/include/rcc/CodeGen/PrologueEpilogueInsertion.h')
| -rw-r--r-- | backend/include/rcc/CodeGen/PrologueEpilogueInsertion.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/backend/include/rcc/CodeGen/PrologueEpilogueInsertion.h b/backend/include/rcc/CodeGen/PrologueEpilogueInsertion.h new file mode 100644 index 0000000..b94715a --- /dev/null +++ b/backend/include/rcc/CodeGen/PrologueEpilogueInsertion.h @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef RCC_CODEGEN_PROLOGUEEPILOGUEINSERTION_H +#define RCC_CODEGEN_PROLOGUEEPILOGUEINSERTION_H + +#include "rcc/CodeGen/MachinePass.h" + +namespace rcc { + +class TargetFrameLowering; + +class PrologueEpilogueInsertionPass final : public MachineFunctionPass { +public: + explicit PrologueEpilogueInsertionPass(const TargetFrameLowering &Info) noexcept : Info(&Info) {} + + [[nodiscard]] const MachinePassContract &contract() const noexcept override; + [[nodiscard]] Expected<MachinePassResult> run(MachineFunction &Function, + const TargetDescription &Target, + MachineAnalysisManager &Analyses) override; + +private: + [[nodiscard]] Expected<MachinePassResult> + runImplementation(MachineFunction &Function, const TargetDescription &Target) const; + + const TargetFrameLowering *Info; +}; + +} // namespace rcc + +#endif // RCC_CODEGEN_PROLOGUEEPILOGUEINSERTION_H |
