2017-02-03 07:53:10 +08:00
|
|
|
//===-- TargetOptionsCommandFlags.cpp ---------------------------*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08: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-03 07:53:10 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2017-10-03 05:00:41 +08:00
|
|
|
#include "lld/Common/TargetOptionsCommandFlags.h"
|
2017-02-03 07:53:10 +08:00
|
|
|
|
2020-03-04 07:47:43 +08:00
|
|
|
#include "llvm/CodeGen/CommandFlags.h"
|
2017-02-03 07:53:10 +08:00
|
|
|
#include "llvm/Target/TargetOptions.h"
|
|
|
|
|
2020-03-04 07:47:43 +08:00
|
|
|
static llvm::codegen::RegisterCodeGenFlags CGF;
|
|
|
|
|
2019-02-01 10:24:50 +08:00
|
|
|
llvm::TargetOptions lld::initTargetOptionsFromCodeGenFlags() {
|
2020-10-14 23:55:55 +08:00
|
|
|
return llvm::codegen::InitTargetOptionsFromCodeGenFlags(llvm::Triple());
|
2017-02-03 07:53:10 +08:00
|
|
|
}
|
2017-03-01 07:43:26 +08:00
|
|
|
|
2019-07-21 05:59:47 +08:00
|
|
|
llvm::Optional<llvm::Reloc::Model> lld::getRelocModelFromCMModel() {
|
2020-03-04 07:47:43 +08:00
|
|
|
return llvm::codegen::getExplicitRelocModel();
|
2019-07-21 05:59:47 +08:00
|
|
|
}
|
|
|
|
|
2019-02-01 10:24:50 +08:00
|
|
|
llvm::Optional<llvm::CodeModel::Model> lld::getCodeModelFromCMModel() {
|
2020-03-04 07:47:43 +08:00
|
|
|
return llvm::codegen::getExplicitCodeModel();
|
2017-03-01 07:43:26 +08:00
|
|
|
}
|
2018-01-31 02:18:59 +08:00
|
|
|
|
2020-03-04 07:47:43 +08:00
|
|
|
std::string lld::getCPUStr() { return llvm::codegen::getCPUStr(); }
|
2019-02-01 10:24:50 +08:00
|
|
|
|
2020-03-04 07:47:43 +08:00
|
|
|
std::vector<std::string> lld::getMAttrs() { return llvm::codegen::getMAttrs(); }
|