diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-28 14:25:42 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-28 14:25:42 +0800 |
| commit | 6889b82a5c9ecc6bd178760c66653d7af0121162 (patch) | |
| tree | d0465db788912487c36bd676656f416eaa8b1642 /backend/include/rcc/CodeGen/TargetMCInstLowering.h | |
| parent | 6e8feb15a0d256ca19e88185f78c81f689ce7d34 (diff) | |
| download | rcc-project-6889b82a5c9ecc6bd178760c66653d7af0121162.tar.gz rcc-project-6889b82a5c9ecc6bd178760c66653d7af0121162.tar.xz | |
[CodeGen] Separate assembly emission ownership
Diffstat (limited to 'backend/include/rcc/CodeGen/TargetMCInstLowering.h')
| -rw-r--r-- | backend/include/rcc/CodeGen/TargetMCInstLowering.h | 41 |
1 files changed, 4 insertions, 37 deletions
diff --git a/backend/include/rcc/CodeGen/TargetMCInstLowering.h b/backend/include/rcc/CodeGen/TargetMCInstLowering.h index 875d2dd..eacb48e 100644 --- a/backend/include/rcc/CodeGen/TargetMCInstLowering.h +++ b/backend/include/rcc/CodeGen/TargetMCInstLowering.h @@ -3,23 +3,16 @@ #ifndef RCC_CODEGEN_TARGETMCINSTLOWERING_H #define RCC_CODEGEN_TARGETMCINSTLOWERING_H +#include "rcc/MC/MCExpr.h" #include "rcc/MC/MCInst.h" #include "rcc/MC/MCInstPrinter.h" -#include "rcc/MC/MCSection.h" #include "rcc/MC/MCStreamer.h" #include "rcc/Support/Error.h" namespace rcc { -class MachineConstantPoolEntry; -class GlobalInitializer; -struct GlobalObjectDesc; -class MachineFunction; class MachineInstr; -class MachineJumpTableEntry; class MachineMCContext; -struct GenericConstantData; -class TargetConstant; class TargetMCInstLowering { public: @@ -30,38 +23,12 @@ public: [[nodiscard]] virtual Expected<mc::MCInst> lowerInstruction(const MachineInstr &Instruction, MachineMCContext &Context) const = 0; + [[nodiscard]] virtual Expected<mc::MCExprRef> + lowerSymbolExpression(mc::MCExprRef Expression, std::uint32_t TargetFlags) const = 0; + [[nodiscard]] virtual Expected<void> emitTerminalInstruction(const MachineInstr &Instruction, MachineMCContext &Context, mc::MCStreamer &Streamer) const; - - [[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; - - [[nodiscard]] virtual Expected<void> emitFileHeader(MachineMCContext &Context, - mc::MCStreamer &Streamer) const; - [[nodiscard]] virtual Expected<void> emitFileTrailer(MachineMCContext &Context, - mc::MCStreamer &Streamer) const; - [[nodiscard]] virtual Expected<void> emitGenericConstant(const GenericConstantData &Constant, - std::uint64_t Size, - MachineMCContext &Context, - mc::MCStreamer &Streamer) const; - [[nodiscard]] virtual Expected<void> emitGlobalInitializer(const GlobalInitializer &Initializer, - MachineMCContext &Context, - mc::MCStreamer &Streamer) const; - [[nodiscard]] virtual Expected<void> emitTargetConstant(const TargetConstant &Constant, - MachineMCContext &Context, - mc::MCStreamer &Streamer) const; - [[nodiscard]] virtual Expected<void> emitTargetJumpTable(const MachineFunction &Function, - const MachineJumpTableEntry &Entry, - MachineMCContext &Context, - mc::MCStreamer &Streamer) const; }; } // namespace rcc |
