diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-28 18:51:10 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-28 18:51:10 +0800 |
| commit | f89d528efc0228c049c2867dcba886a56bac8619 (patch) | |
| tree | 7a47f751e729845af1537beee20bc57007d3e21c /backend/include/rcc/Target/TargetOptions.h | |
| parent | 6889b82a5c9ecc6bd178760c66653d7af0121162 (diff) | |
| download | rcc-project-f89d528efc0228c049c2867dcba886a56bac8619.tar.gz rcc-project-f89d528efc0228c049c2867dcba886a56bac8619.tar.xz | |
[CodeGen] Add target machine registry
Diffstat (limited to 'backend/include/rcc/Target/TargetOptions.h')
| -rw-r--r-- | backend/include/rcc/Target/TargetOptions.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/backend/include/rcc/Target/TargetOptions.h b/backend/include/rcc/Target/TargetOptions.h new file mode 100644 index 0000000..1db183c --- /dev/null +++ b/backend/include/rcc/Target/TargetOptions.h @@ -0,0 +1,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 |
