LLVM 24.0.0git
MCTargetOptions.h
Go to the documentation of this file.
1//===- MCTargetOptions.h - MC Target Options --------------------*- 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#ifndef LLVM_MC_MCTARGETOPTIONS_H
10#define LLVM_MC_MCTARGETOPTIONS_H
11
12#include "llvm/ADT/ArrayRef.h"
16#include <string>
17#include <utility>
18#include <vector>
19
20namespace llvm {
21
23 Always, // Always emit dwarf unwind
24 NoCompactUnwind, // Only emit if compact unwind isn't available
25 DwarfOnly, // Force compact unwind to reference DWARF
26 Default, // Default behavior is based on the target
27};
28
29// For ELF targets, whether to adjust relocations referencing eligible local
30// symbols to use section symbols.
32 All, // For all eligible local symbols (default)
33 Internal, // For .L symbols
34 None, // Never use section symbols
35};
36
37class StringRef;
38
40public:
45
46 bool MCRelaxAll : 1;
47 bool MCNoExecStack : 1;
49 bool MCNoWarn : 1;
51 bool MCNoTypeCheck : 1;
54 bool FDPIC : 1;
56 bool ShowMCInst : 1;
57 bool AsmVerbose : 1;
58
59 /// Preserve Comments in Assembly.
61
62 bool Dwarf64 : 1;
63
64 // Use CREL relocation format for ELF.
65 bool Crel = false;
66
67 bool ImplicitMapSyms = false;
68
69 // If true, prefer R_X86_64_[REX_]GOTPCRELX to R_X86_64_GOTPCREL on x86-64
70 // ELF.
72
73 bool X86Sse2Avx = false;
74
75 // Disable the integrated assembler.
76 bool DisableIntegratedAS = false;
77
78 // For ELF relocations, controls section symbol conversion.
80
81 std::optional<unsigned> OutputAsmVariant;
82
84
85 int DwarfVersion = 0;
86
87 /// If greater than 0, overrides the default MCAsmInfo binutils version.
88 std::pair<int, int> BinutilsVersion = {0, 0};
89
91 // Force disable
93 // Force enable, for assemblers that support
94 // `.file fileno directory filename' syntax
96 // Default is based on the target
98 };
100
101 // Whether to compress DWARF debug sections.
103
104 std::string ABIName;
105 std::string AssemblyLanguage;
106 std::string SplitDwarfFile;
107 std::string AsSecureLogFile;
108
109 // Used for codeview debug info. These will be set as compiler path and commandline arguments in LF_BUILDINFO
110 std::string Argv0;
111 std::string CommandlineArgs;
112
113 /// Additional paths to search for `.include` directives when using the
114 /// integrated assembler.
115 std::vector<std::string> IASSearchPaths;
116
117 // InstPrinter options.
118 std::vector<std::string> InstPrinterOptions;
119
120 // Whether to emit compact-unwind for non-canonical personality
121 // functions on Darwins.
123
124 // Whether to emit SFrame unwind sections.
126
127 // Whether or not to use full register names on PowerPC.
129
130 // Force 8-byte (sdata8) pointer encodings for ELF exception-handling.
131 // On x86_64 this affects the .eh_frame FDE CFI plus the personality, LSDA,
132 // and TType encodings; on AArch64/PPC64 only the FDE CFI encoding changes
133 // (personality/LSDA/TType already default to sdata8).
134 bool LargeEHEncoding = false;
135
137
138 /// Parse a binutils version string ("major[.minor]" or "none") into a
139 /// (major, minor) pair. "none" maps to {INT_MAX, INT_MAX}.
140 LLVM_ABI static std::pair<int, int> parseBinutilsVersion(StringRef Version);
141
142 /// getABIName - If this returns a non-empty string this represents the
143 /// textual name of the ABI that we want the backend to use, e.g. o32, or
144 /// aapcs-linux.
146
147 /// getAssemblyLanguage - If this returns a non-empty string this represents
148 /// the textual name of the assembly language that we will use for this
149 /// target, e.g. masm.
151};
152
153} // end namespace llvm
154
155#endif // LLVM_MC_MCTARGETOPTIONS_H
#define LLVM_ABI
Definition Compiler.h:215
bool PreserveAsmComments
Preserve Comments in Assembly.
DwarfDirectory MCUseDwarfDirectory
EmitDwarfUnwindType EmitDwarfUnwind
std::vector< std::string > InstPrinterOptions
RelocSectionSymType RelocSectionSym
std::optional< unsigned > OutputAsmVariant
DebugCompressionType CompressDebugSections
std::vector< std::string > IASSearchPaths
Additional paths to search for .include directives when using the integrated assembler.
LLVM_ABI StringRef getAssemblyLanguage() const
getAssemblyLanguage - If this returns a non-empty string this represents the textual name of the asse...
std::pair< int, int > BinutilsVersion
If greater than 0, overrides the default MCAsmInfo binutils version.
LLVM_ABI StringRef getABIName() const
getABIName - If this returns a non-empty string this represents the textual name of the ABI that we w...
static LLVM_ABI std::pair< int, int > parseBinutilsVersion(StringRef Version)
Parse a binutils version string ("major[.minor]" or "none") into a (major, minor) pair.
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
This is an optimization pass for GlobalISel generic memory operations.
RelocSectionSymType
EmitDwarfUnwindType
DebugCompressionType
Definition Compression.h:28
@ None
No compression.
Definition Compression.h:29
@ Always
Always emit .debug_str_offsets talbes as DWARF64 for testing.
Definition DWP.h:32
@ Default
The result value is uniform if and only if all operands are uniform.
Definition Uniformity.h:20