aboutsummaryrefslogtreecommitdiff
path: root/backend/include/rcc/CodeGen/TargetLoweringObjectFile.h
blob: f415e4f79c905fb8ce1b3240f4415b2092ec6b22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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