2017-02-02 23:53:10 +00:00
|
|
|
//===-- TargetOptionsCommandFlags.cpp ---------------------------*- C++ -*-===//
|
|
|
|
|
//
|
2019-01-19 08:50:56 +00: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-02-02 23:53:10 +00:00
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
2017-10-02 21:00:41 +00:00
|
|
|
#include "lld/Common/TargetOptionsCommandFlags.h"
|
2020-03-04 00:47:43 +01:00
|
|
|
#include "llvm/CodeGen/CommandFlags.h"
|
2017-02-02 23:53:10 +00:00
|
|
|
#include "llvm/Target/TargetOptions.h"
|
2023-02-07 12:21:51 +00:00
|
|
|
#include "llvm/TargetParser/Triple.h"
|
2022-12-03 11:06:12 -06:00
|
|
|
#include <optional>
|
2017-02-02 23:53:10 +00:00
|
|
|
|
2019-02-01 02:24:50 +00:00
|
|
|
llvm::TargetOptions lld::initTargetOptionsFromCodeGenFlags() {
|
2020-10-14 15:55:55 +00:00
|
|
|
return llvm::codegen::InitTargetOptionsFromCodeGenFlags(llvm::Triple());
|
2017-02-02 23:53:10 +00:00
|
|
|
}
|
2017-02-28 23:43:26 +00:00
|
|
|
|
2022-12-03 18:38:12 +00:00
|
|
|
std::optional<llvm::Reloc::Model> lld::getRelocModelFromCMModel() {
|
2020-03-04 00:47:43 +01:00
|
|
|
return llvm::codegen::getExplicitRelocModel();
|
2019-07-20 21:59:47 +00:00
|
|
|
}
|
|
|
|
|
|
2022-12-03 11:06:12 -06:00
|
|
|
std::optional<llvm::CodeModel::Model> lld::getCodeModelFromCMModel() {
|
2020-03-04 00:47:43 +01:00
|
|
|
return llvm::codegen::getExplicitCodeModel();
|
2017-02-28 23:43:26 +00:00
|
|
|
}
|
2018-01-30 18:18:59 +00:00
|
|
|
|
2020-03-04 00:47:43 +01:00
|
|
|
std::string lld::getCPUStr() { return llvm::codegen::getCPUStr(); }
|
2019-02-01 02:24:50 +00:00
|
|
|
|
2020-03-04 00:47:43 +01:00
|
|
|
std::vector<std::string> lld::getMAttrs() { return llvm::codegen::getMAttrs(); }
|