LLVM 24.0.0git
MCTargetOptionsCommandFlags.cpp
Go to the documentation of this file.
1//===-- MCTargetOptionsCommandFlags.cpp -----------------------*- C++ //-*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8//
9// This file contains machine code-specific flags that are shared between
10// different command line tools.
11//
12//===----------------------------------------------------------------------===//
13
17
18using namespace llvm;
19
20#define OPTIONS_STRUCT_DECL
21#include "MCToolOptions.inc"
22
23#define OPTIONS_STRUCT_DEFS
24#include "MCToolOptions.inc"
25
27 static constexpr opt::LibraryOptionsParser Parser(
28 std::in_place_type<MCToolOptions>);
29 static constexpr const cl::LibraryOptions *Libraries[] = {&Parser};
30 return Libraries;
31}
32
34 return C.get<MCToolOptions>().target_abi;
35}
36
39 const MCToolOptions &Opts = C.get<MCToolOptions>();
41 Options.LibraryOptions = &C;
42 Options.MCRelaxAll = Opts.mc_relax_all;
43 Options.MCIncrementalLinkerCompatible = Opts.incremental_linker_compatible;
44 Options.FDPIC = Opts.fdpic;
45 Options.Dwarf64 = Opts.dwarf64;
46 Options.DwarfVersion = Opts.dwarf_version;
47 Options.ShowMCInst = Opts.asm_show_inst;
48 Options.ABIName = Opts.target_abi;
49 Options.MCFatalWarnings = Opts.fatal_warnings;
50 Options.MCNoWarn = Opts.no_warn;
51 Options.MCNoDeprecatedWarn = Opts.no_deprecated_warn;
52 Options.MCNoTypeCheck = Opts.no_type_check;
53 Options.MCSaveTempLabels = Opts.save_temp_labels;
54 Options.Crel = Opts.crel;
55 Options.ImplicitMapSyms = Opts.implicit_mapsyms;
56 Options.MachORelocatableDwarf = Opts.macho_relocatable_dwarf;
57 Options.X86RelaxRelocations = Opts.x86_relax_relocations;
58 Options.X86Sse2Avx = Opts.x86_sse2avx;
59 Options.DisableIntegratedAS = Opts.no_integrated_as;
60 Options.RelocSectionSym = Opts.reloc_section_sym;
61 Options.LargeEHEncoding = Opts.large_eh_encoding;
62 Options.EmitDwarfUnwind = Opts.emit_dwarf_unwind;
63 Options.EmitCompactUnwindNonCanonical =
64 Opts.emit_compact_unwind_non_canonical;
65 Options.EmitSFrameUnwind = Opts.gsframe;
66 Options.AsSecureLogFile = Opts.as_secure_log_file;
67
68 return Options;
69}
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
static LVOptions Options
Definition LVOptions.cpp:25
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
The options of a library that declares them in TableGen rather than as cl::opt (see llvm/Option/Libra...
Connects options struct T to cl::parseCommandLineOptions and cl::LibraryOptionsContext.
LLVM_ABI MCTargetOptions getMCTargetOptions(const cl::LibraryOptionsContext &C)
LLVM_ABI ArrayRef< const cl::LibraryOptions * > getToolOptions()
The options that a tool reading getMCTargetOptions passes to cl::parseCommandLineOptions.
LLVM_ABI StringRef getABIName(const cl::LibraryOptionsContext &C)
This is an optimization pass for GlobalISel generic memory operations.