aboutsummaryrefslogtreecommitdiff
path: root/backend/include/rcc/CodeGen/TargetLoweringObjectFile.h
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-28 14:25:42 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-28 14:25:42 +0800
commit6889b82a5c9ecc6bd178760c66653d7af0121162 (patch)
treed0465db788912487c36bd676656f416eaa8b1642 /backend/include/rcc/CodeGen/TargetLoweringObjectFile.h
parent6e8feb15a0d256ca19e88185f78c81f689ce7d34 (diff)
downloadrcc-project-6889b82a5c9ecc6bd178760c66653d7af0121162.tar.gz
rcc-project-6889b82a5c9ecc6bd178760c66653d7af0121162.tar.xz
[CodeGen] Separate assembly emission ownership
Diffstat (limited to 'backend/include/rcc/CodeGen/TargetLoweringObjectFile.h')
-rw-r--r--backend/include/rcc/CodeGen/TargetLoweringObjectFile.h34
1 files changed, 34 insertions, 0 deletions
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<mc::MCSectionDesc>
+ textSection(const MachineFunction &Function) const = 0;
+ [[nodiscard]] virtual Expected<mc::MCSectionDesc>
+ globalSection(const GlobalObjectDesc &Object, MachineMCContext &Context) const = 0;
+ [[nodiscard]] virtual Expected<mc::MCSectionDesc>
+ constantPoolSection(const MachineFunction &Function,
+ const MachineConstantPoolEntry &Entry) const = 0;
+ [[nodiscard]] virtual Expected<mc::MCSectionDesc>
+ jumpTableSection(const MachineFunction &Function, const MachineJumpTableEntry &Entry) const = 0;
+};
+
+} // namespace rcc
+
+#endif // RCC_CODEGEN_TARGETLOWERINGOBJECTFILE_H