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 --- .../include/rcc/CodeGen/TargetLoweringObjectFile.h | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 backend/include/rcc/CodeGen/TargetLoweringObjectFile.h (limited to 'backend/include/rcc/CodeGen/TargetLoweringObjectFile.h') diff --git a/backend/include/rcc/CodeGen/TargetLoweringObjectFile.h b/backend/include/rcc/CodeGen/TargetLoweringObjectFile.h new file mode 100644 index 0000000..f415e4f --- /dev/null +++ b/backend/include/rcc/CodeGen/TargetLoweringObjectFile.h @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef RCC_CODEGEN_TARGETLOWERINGOBJECTFILE_H +#define RCC_CODEGEN_TARGETLOWERINGOBJECTFILE_H + +#include "rcc/MC/MCSection.h" +#include "rcc/Support/Error.h" + +namespace rcc { + +struct GlobalObjectDesc; +class MachineConstantPoolEntry; +class MachineFunction; +class MachineJumpTableEntry; +class MachineMCContext; + +class TargetLoweringObjectFile { +public: + virtual ~TargetLoweringObjectFile() = default; + + [[nodiscard]] virtual Expected + textSection(const MachineFunction &Function) const = 0; + [[nodiscard]] virtual Expected + globalSection(const GlobalObjectDesc &Object, MachineMCContext &Context) const = 0; + [[nodiscard]] virtual Expected + constantPoolSection(const MachineFunction &Function, + const MachineConstantPoolEntry &Entry) const = 0; + [[nodiscard]] virtual Expected + jumpTableSection(const MachineFunction &Function, const MachineJumpTableEntry &Entry) const = 0; +}; + +} // namespace rcc + +#endif // RCC_CODEGEN_TARGETLOWERINGOBJECTFILE_H -- cgit v1.2.3