LLVM: lib/MC/MCTargetOptionsCommandFlags.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
17
18using namespace llvm;
19
20#define MCOPT(TY, NAME) \
21 static cl::opt *NAME##View; \
22 TY llvm::mc::get##NAME() { \
23 assert(NAME##View && "RegisterMCTargetOptionsFlags not created."); \
24 return *NAME##View; \
25 }
26
27#define MCSTROPT(NAME) \
28 static cl::optstd::string *NAME##View; \
29 StringRef llvm::mc::get##NAME() { \
30 assert(NAME##View && "RegisterMCTargetOptionsFlags not created."); \
31 return *NAME##View; \
32 }
33
34#define MCOPT_EXP(TY, NAME) \
35 MCOPT(TY, NAME) \
36 std::optional llvm::mc::getExplicit##NAME() { \
37 if (NAME##View->getNumOccurrences()) { \
38 TY res = *NAME##View; \
39 return res; \
40 } \
41 return std::nullopt; \
42 }
43
45MCOPT(bool, IncrementalLinkerCompatible)
47MCOPT(int, DwarfVersion)
48MCOPT(bool, Dwarf64)
50MCOPT(bool, EmitCompactUnwindNonCanonical)
51MCOPT(bool, EmitSFrameUnwind)
52MCOPT(bool, ShowMCInst)
53MCOPT(bool, FatalWarnings)
54MCOPT(bool, NoWarn)
55MCOPT(bool, NoDeprecatedWarn)
56MCOPT(bool, NoTypeCheck)
57MCOPT(bool, SaveTempLabels)
59MCOPT(bool, ImplicitMapSyms)
60MCOPT(bool, X86RelaxRelocations)
61MCOPT(bool, X86Sse2Avx)
64
66#define MCBINDOPT(NAME) \
67 do { \
68 NAME##View = std::addressof(NAME); \
69 } while (0)
70
72 "mc-relax-all", cl::desc("When used with filetype=obj, relax all fixups "
73 "in the emitted object file"));
75
77 "incremental-linker-compatible",
79 "When used with filetype=obj, "
80 "emit an object file which can be used with an incremental linker"));
81 MCBINDOPT(IncrementalLinkerCompatible);
82
85
89
91 "dwarf64",
92 cl::desc("Generate debugging info in the 64-bit DWARF format"));
94
96 "emit-dwarf-unwind", cl::desc("Whether to emit DWARF EH frame entries."),
99 "Always emit EH frame entries"),
101 "no-compact-unwind",
102 "Only emit EH frame entries when compact unwind is "
103 "not available"),
105 "Use target platform default")));
107
108 static cl::opt EmitCompactUnwindNonCanonical(
109 "emit-compact-unwind-non-canonical",
111 "Whether to try to emit Compact Unwind for non canonical entries."),
113 false));
114 MCBINDOPT(EmitCompactUnwindNonCanonical);
115
117 "gsframe", cl::desc("Whether to emit .sframe unwind sections."),
120
122 "asm-show-inst",
123 cl::desc("Emit internal instruction representation to assembly file"));
125
126 static cl::opt FatalWarnings("fatal-warnings",
127 cl::desc("Treat warnings as errors"));
129
134
136 "no-deprecated-warn", cl::desc("Suppress all deprecated warnings"));
138
140 "no-type-check", cl::desc("Suppress type errors (Wasm)"));
142
144 "save-temp-labels", cl::desc("Don't discard temporary labels"));
146
148 cl::desc("Use CREL relocation format for ELF"));
150
152 "implicit-mapsyms",
153 cl::desc("Allow mapping symbol at section beginning to be implicit, "
154 "lowering number of mapping symbols at the expense of some "
155 "portability. Recommended for projects that can build all their "
156 "object files using this option"));
158
160 "x86-relax-relocations",
161 cl::desc("Emit GOTPCRELX/REX_GOTPCRELX/CODE_4_GOTPCRELX instead of "
162 "GOTPCREL on x86-64 ELF"),
165
167 "x86-sse2avx", cl::desc("Specify that the assembler should encode SSE "
168 "instructions with VEX prefix"));
170
172 "target-abi",
173 cl::desc("The name of the ABI to be targeted from the backend."),
176
178 "as-secure-log-file", cl::desc("As secure log file name"), cl::Hidden);
180
181#undef MCBINDOPT
182}
183
#define clEnumValN(ENUMVAL, FLAGNAME, DESC)
#define MCOPT(TY, NAME)
Definition MCTargetOptionsCommandFlags.cpp:20
#define MCSTROPT(NAME)
Definition MCTargetOptionsCommandFlags.cpp:27
#define MCOPT_EXP(TY, NAME)
Definition MCTargetOptionsCommandFlags.cpp:34
ValuesClass values(OptsTy... Options)
Helper to build a ValuesClass by forwarding a variable number of arguments as an initializer list to ...
initializer< Ty > init(const Ty &Val)
LLVM_ABI bool getEmitCompactUnwindNonCanonical()
LLVM_ABI bool getDwarf64()
LLVM_ABI bool getEmitSFrameUnwind()
LLVM_ABI bool getX86Sse2Avx()
LLVM_ABI MCTargetOptions InitMCTargetOptionsFromFlags()
Definition MCTargetOptionsCommandFlags.cpp:184
LLVM_ABI bool getIncrementalLinkerCompatible()
LLVM_ABI bool getNoDeprecatedWarn()
LLVM_ABI bool getNoTypeCheck()
LLVM_ABI EmitDwarfUnwindType getEmitDwarfUnwind()
LLVM_ABI bool getSaveTempLabels()
LLVM_ABI bool getImplicitMapSyms()
LLVM_ABI bool getFatalWarnings()
LLVM_ABI bool getRelaxAll()
LLVM_ABI bool getX86RelaxRelocations()
LLVM_ABI bool getShowMCInst()
LLVM_ABI StringRef getAsSecureLogFile()
LLVM_ABI int getDwarfVersion()
LLVM_ABI StringRef getABIName()
LLVM_ABI bool getNoWarn()
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI RegisterMCTargetOptionsFlags()
Definition MCTargetOptionsCommandFlags.cpp:65