2017-04-16 12:03:39 -04:00
|
|
|
//===-- TargetOptionsCommandFlags.cpp ---------------------------*- C++ -*-===//
|
|
|
|
|
//
|
2019-08-20 16:51:32 -04:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2017-04-16 12:03:39 -04:00
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
2017-12-18 15:12:21 -05:00
|
|
|
#include "lld/Common/TargetOptionsCommandFlags.h"
|
2020-07-26 15:36:28 -04:00
|
|
|
#include "llvm/CodeGen/CommandFlags.h"
|
2017-04-16 12:03:39 -04:00
|
|
|
#include "llvm/Target/TargetOptions.h"
|
2023-09-02 17:17:18 -04:00
|
|
|
#include "llvm/TargetParser/Triple.h"
|
2023-02-11 07:38:04 -05:00
|
|
|
#include <optional>
|
2017-04-16 12:03:39 -04:00
|
|
|
|
2019-08-20 16:51:32 -04:00
|
|
|
llvm::TargetOptions lld::initTargetOptionsFromCodeGenFlags() {
|
2021-02-16 15:13:02 -05:00
|
|
|
return llvm::codegen::InitTargetOptionsFromCodeGenFlags(llvm::Triple());
|
2017-04-16 12:03:39 -04:00
|
|
|
}
|
|
|
|
|
|
2023-02-11 07:38:04 -05:00
|
|
|
std::optional<llvm::Reloc::Model> lld::getRelocModelFromCMModel() {
|
2020-07-26 15:36:28 -04:00
|
|
|
return llvm::codegen::getExplicitRelocModel();
|
2019-10-23 13:52:45 -04:00
|
|
|
}
|
|
|
|
|
|
2023-02-11 07:38:04 -05:00
|
|
|
std::optional<llvm::CodeModel::Model> lld::getCodeModelFromCMModel() {
|
2020-07-26 15:36:28 -04:00
|
|
|
return llvm::codegen::getExplicitCodeModel();
|
2017-04-16 12:03:39 -04:00
|
|
|
}
|
2018-07-28 07:08:33 -04:00
|
|
|
|
2020-07-26 15:36:28 -04:00
|
|
|
std::string lld::getCPUStr() { return llvm::codegen::getCPUStr(); }
|
2019-08-20 16:51:32 -04:00
|
|
|
|
2020-07-26 15:36:28 -04:00
|
|
|
std::vector<std::string> lld::getMAttrs() { return llvm::codegen::getMAttrs(); }
|