Bob Haarman | fbc229d | 2017-02-02 23:53:10 | [diff] [blame] | 1 | //===-- TargetOptionsCommandFlags.cpp ---------------------------*- C++ -*-===// |
| 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 | [diff] [blame] | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Bob Haarman | fbc229d | 2017-02-02 23:53:10 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // This file exists as a place for global variables defined in LLVM's |
Fangrui Song | 8d3fcb4 | 2018-05-22 06:12:23 | [diff] [blame] | 10 | // CodeGen/CommandFlags.inc. By putting the resulting object file in |
Bob Haarman | fbc229d | 2017-02-02 23:53:10 | [diff] [blame] | 11 | // an archive and linking with it, the definitions will automatically be |
| 12 | // included when needed and skipped when already present. |
| 13 | // |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | |
Rui Ueyama | 3f85170 | 2017-10-02 21:00:41 | [diff] [blame] | 16 | #include "lld/Common/TargetOptionsCommandFlags.h" |
Bob Haarman | fbc229d | 2017-02-02 23:53:10 | [diff] [blame] | 17 | |
David Blaikie | ad19118 | 2018-04-11 18:49:41 | [diff] [blame] | 18 | #include "llvm/CodeGen/CommandFlags.inc" |
Bob Haarman | fbc229d | 2017-02-02 23:53:10 | [diff] [blame] | 19 | #include "llvm/Target/TargetOptions.h" |
| 20 | |
| 21 | // Define an externally visible version of |
Sam Clegg | dfbd190 | 2019-02-01 02:24:50 | [diff] [blame^] | 22 | // initTargetOptionsFromCodeGenFlags, so that its functionality can be |
Fangrui Song | 8d3fcb4 | 2018-05-22 06:12:23 | [diff] [blame] | 23 | // used without having to include llvm/CodeGen/CommandFlags.inc, which |
Bob Haarman | fbc229d | 2017-02-02 23:53:10 | [diff] [blame] | 24 | // would lead to multiple definitions of the command line flags. |
Sam Clegg | dfbd190 | 2019-02-01 02:24:50 | [diff] [blame^] | 25 | llvm::TargetOptions lld::initTargetOptionsFromCodeGenFlags() { |
Bob Haarman | fbc229d | 2017-02-02 23:53:10 | [diff] [blame] | 26 | return ::InitTargetOptionsFromCodeGenFlags(); |
| 27 | } |
Martell Malone | 6b43b7a | 2017-02-28 23:43:26 | [diff] [blame] | 28 | |
Sam Clegg | dfbd190 | 2019-02-01 02:24:50 | [diff] [blame^] | 29 | llvm::Optional<llvm::CodeModel::Model> lld::getCodeModelFromCMModel() { |
Rafael Espindola | eaf1d56 | 2017-08-03 02:16:33 | [diff] [blame] | 30 | return getCodeModel(); |
Martell Malone | 6b43b7a | 2017-02-28 23:43:26 | [diff] [blame] | 31 | } |
Rafael Espindola | 3a730d8 | 2018-01-30 18:18:59 | [diff] [blame] | 32 | |
Sam Clegg | dfbd190 | 2019-02-01 02:24:50 | [diff] [blame^] | 33 | std::string lld::getCPUStr() { return ::getCPUStr(); } |
| 34 | |
| 35 | std::vector<std::string> lld::getMAttrs() { return ::MAttrs; } |