From 6889b82a5c9ecc6bd178760c66653d7af0121162 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Fri, 28 Aug 2026 14:25:42 +0800 Subject: [CodeGen] Separate assembly emission ownership --- backend/lib/Target/RISCV/RISCVTargetObjectFile.h | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 backend/lib/Target/RISCV/RISCVTargetObjectFile.h (limited to 'backend/lib/Target/RISCV/RISCVTargetObjectFile.h') diff --git a/backend/lib/Target/RISCV/RISCVTargetObjectFile.h b/backend/lib/Target/RISCV/RISCVTargetObjectFile.h new file mode 100644 index 0000000..cf8db36 --- /dev/null +++ b/backend/lib/Target/RISCV/RISCVTargetObjectFile.h @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef RCC_TARGET_RISCV_RISCVTARGETOBJECTFILE_H +#define RCC_TARGET_RISCV_RISCVTARGETOBJECTFILE_H + +#include "rcc/CodeGen/TargetLoweringObjectFile.h" + +namespace rcc::riscv { + +class RISCVELFTargetObjectFile final : public TargetLoweringObjectFile { +public: + [[nodiscard]] Expected + textSection(const MachineFunction &Function) const override; + [[nodiscard]] Expected globalSection(const GlobalObjectDesc &Object, + MachineMCContext &Context) const override; + [[nodiscard]] Expected + constantPoolSection(const MachineFunction &Function, + const MachineConstantPoolEntry &Entry) const override; + [[nodiscard]] Expected + jumpTableSection(const MachineFunction &Function, + const MachineJumpTableEntry &Entry) const override; +}; + +} // namespace rcc::riscv + +#endif // RCC_TARGET_RISCV_RISCVTARGETOBJECTFILE_H -- cgit v1.2.3