aboutsummaryrefslogtreecommitdiff
path: root/backend/include/rcc/Target/TargetOptions.h
blob: 1db183c86a627e6e7340c324eda08d5ed4da1628 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// SPDX-License-Identifier: GPL-3.0-or-later

#ifndef RCC_TARGET_TARGETOPTIONS_H
#define RCC_TARGET_TARGETOPTIONS_H

#include "rcc/CodeGen/CommandFlags.h"

#include <string>
#include <vector>

namespace rcc {

struct TargetOption final {
  std::string Name;
  std::string Value;

  friend bool operator==(const TargetOption &, const TargetOption &) = default;
};

struct TargetMachineOptions final {
  std::string Triple;
  std::string CPU;
  std::string TuneCPU;
  std::vector<std::string> Features;
  std::string ABI;
  std::string DataLayout;
  RelocationModel Relocation = RelocationModel::Static;
  CodeModel Code = CodeModel::Small;
  OptimizationLevel Optimization = OptimizationLevel::O2;
  std::vector<TargetOption> Options;
  std::string ABILoweringVersion;
  std::string AssemblerFlavor;
  std::string AssemblerVersion;
  std::vector<TargetOption> AssemblerOptions;

  friend bool operator==(const TargetMachineOptions &, const TargetMachineOptions &) = default;
};

struct TargetPipelineOptions final {
  OptimizationLevel Optimization = OptimizationLevel::O2;
  bool UseTargetCopyInstructions = false;
  GlobalISelAbortMode GlobalISelAbort = GlobalISelAbortMode::Enable;
  bool DebugMachineScheduler = false;
  bool DebugPrologueEpilogue = false;
};

} // namespace rcc

#endif // RCC_TARGET_TARGETOPTIONS_H