]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/include/llvm/CodeGen/CommandFlags.h
MFC r244628:
[FreeBSD/stable/9.git] / contrib / llvm / include / llvm / CodeGen / CommandFlags.h
1 //===-- CommandFlags.h - Register Coalescing Interface ----------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains codegen-specific flags that are shared between different
11 // command line tools. The tools "llc" and "opt" both use this file to prevent
12 // flag duplication.
13 //
14 //===----------------------------------------------------------------------===//
15
16 #ifndef LLVM_CODEGEN_COMMAND_LINE_FLAGS_H
17 #define LLVM_CODEGEN_COMMAND_LINE_FLAGS_H
18
19 #include "llvm/Support/CommandLine.h"
20 #include "llvm/Support/CodeGen.h"
21 #include "llvm/Target/TargetMachine.h"
22
23 #include <string>
24 using namespace llvm;
25
26 cl::opt<std::string>
27 MArch("march", cl::desc("Architecture to generate code for (see --version)"));
28
29 cl::opt<std::string>
30 MCPU("mcpu",
31      cl::desc("Target a specific cpu type (-mcpu=help for details)"),
32      cl::value_desc("cpu-name"),
33      cl::init(""));
34
35 cl::list<std::string>
36 MAttrs("mattr",
37        cl::CommaSeparated,
38        cl::desc("Target specific attributes (-mattr=help for details)"),
39        cl::value_desc("a1,+a2,-a3,..."));
40
41 cl::opt<Reloc::Model>
42 RelocModel("relocation-model",
43            cl::desc("Choose relocation model"),
44            cl::init(Reloc::Default),
45            cl::values(
46               clEnumValN(Reloc::Default, "default",
47                       "Target default relocation model"),
48               clEnumValN(Reloc::Static, "static",
49                       "Non-relocatable code"),
50               clEnumValN(Reloc::PIC_, "pic",
51                       "Fully relocatable, position independent code"),
52               clEnumValN(Reloc::DynamicNoPIC, "dynamic-no-pic",
53                       "Relocatable external references, non-relocatable code"),
54               clEnumValEnd));
55
56 cl::opt<llvm::CodeModel::Model>
57 CMModel("code-model",
58         cl::desc("Choose code model"),
59         cl::init(CodeModel::Default),
60         cl::values(clEnumValN(CodeModel::Default, "default",
61                               "Target default code model"),
62                    clEnumValN(CodeModel::Small, "small",
63                               "Small code model"),
64                    clEnumValN(CodeModel::Kernel, "kernel",
65                               "Kernel code model"),
66                    clEnumValN(CodeModel::Medium, "medium",
67                               "Medium code model"),
68                    clEnumValN(CodeModel::Large, "large",
69                               "Large code model"),
70                    clEnumValEnd));
71
72 cl::opt<bool>
73 RelaxAll("mc-relax-all",
74          cl::desc("When used with filetype=obj, "
75                   "relax all fixups in the emitted object file"));
76
77 cl::opt<TargetMachine::CodeGenFileType>
78 FileType("filetype", cl::init(TargetMachine::CGFT_AssemblyFile),
79   cl::desc("Choose a file type (not all types are supported by all targets):"),
80   cl::values(
81              clEnumValN(TargetMachine::CGFT_AssemblyFile, "asm",
82                         "Emit an assembly ('.s') file"),
83              clEnumValN(TargetMachine::CGFT_ObjectFile, "obj",
84                         "Emit a native object ('.o') file"),
85              clEnumValN(TargetMachine::CGFT_Null, "null",
86                         "Emit nothing, for performance testing"),
87              clEnumValEnd));
88
89 cl::opt<bool> DisableDotLoc("disable-dot-loc", cl::Hidden,
90                             cl::desc("Do not use .loc entries"));
91
92 cl::opt<bool> DisableCFI("disable-cfi", cl::Hidden,
93                          cl::desc("Do not use .cfi_* directives"));
94
95 cl::opt<bool> EnableDwarfDirectory("enable-dwarf-directory", cl::Hidden,
96                   cl::desc("Use .file directives with an explicit directory."));
97
98 cl::opt<bool>
99 DisableRedZone("disable-red-zone",
100                cl::desc("Do not emit code that uses the red zone."),
101                cl::init(false));
102
103 cl::opt<bool>
104 EnableFPMAD("enable-fp-mad",
105             cl::desc("Enable less precise MAD instructions to be generated"),
106             cl::init(false));
107
108 cl::opt<bool>
109 DisableFPElim("disable-fp-elim",
110               cl::desc("Disable frame pointer elimination optimization"),
111               cl::init(false));
112
113 cl::opt<bool>
114 DisableFPElimNonLeaf("disable-non-leaf-fp-elim",
115   cl::desc("Disable frame pointer elimination optimization for non-leaf funcs"),
116   cl::init(false));
117
118 cl::opt<bool>
119 EnableUnsafeFPMath("enable-unsafe-fp-math",
120                 cl::desc("Enable optimizations that may decrease FP precision"),
121                 cl::init(false));
122
123 cl::opt<bool>
124 EnableNoInfsFPMath("enable-no-infs-fp-math",
125                 cl::desc("Enable FP math optimizations that assume no +-Infs"),
126                 cl::init(false));
127
128 cl::opt<bool>
129 EnableNoNaNsFPMath("enable-no-nans-fp-math",
130                    cl::desc("Enable FP math optimizations that assume no NaNs"),
131                    cl::init(false));
132
133 cl::opt<bool>
134 EnableHonorSignDependentRoundingFPMath("enable-sign-dependent-rounding-fp-math",
135       cl::Hidden,
136       cl::desc("Force codegen to assume rounding mode can change dynamically"),
137       cl::init(false));
138
139 cl::opt<bool>
140 GenerateSoftFloatCalls("soft-float",
141                     cl::desc("Generate software floating point library calls"),
142                     cl::init(false));
143
144 cl::opt<llvm::FloatABI::ABIType>
145 FloatABIForCalls("float-abi",
146                  cl::desc("Choose float ABI type"),
147                  cl::init(FloatABI::Default),
148                  cl::values(
149                      clEnumValN(FloatABI::Default, "default",
150                                 "Target default float ABI type"),
151                      clEnumValN(FloatABI::Soft, "soft",
152                                 "Soft float ABI (implied by -soft-float)"),
153                      clEnumValN(FloatABI::Hard, "hard",
154                                 "Hard float ABI (uses FP registers)"),
155                      clEnumValEnd));
156
157 cl::opt<llvm::FPOpFusion::FPOpFusionMode>
158 FuseFPOps("fp-contract",
159           cl::desc("Enable aggresive formation of fused FP ops"),
160           cl::init(FPOpFusion::Standard),
161           cl::values(
162               clEnumValN(FPOpFusion::Fast, "fast",
163                          "Fuse FP ops whenever profitable"),
164               clEnumValN(FPOpFusion::Standard, "on",
165                          "Only fuse 'blessed' FP ops."),
166               clEnumValN(FPOpFusion::Strict, "off",
167                          "Only fuse FP ops when the result won't be effected."),
168               clEnumValEnd));
169
170 cl::opt<bool>
171 DontPlaceZerosInBSS("nozero-initialized-in-bss",
172               cl::desc("Don't place zero-initialized symbols into bss section"),
173               cl::init(false));
174
175 cl::opt<bool>
176 EnableGuaranteedTailCallOpt("tailcallopt",
177   cl::desc("Turn fastcc calls into tail calls by (potentially) changing ABI."),
178   cl::init(false));
179
180 cl::opt<bool>
181 DisableTailCalls("disable-tail-calls",
182                  cl::desc("Never emit tail calls"),
183                  cl::init(false));
184
185 cl::opt<unsigned>
186 OverrideStackAlignment("stack-alignment",
187                        cl::desc("Override default stack alignment"),
188                        cl::init(0));
189
190 cl::opt<bool>
191 EnableRealignStack("realign-stack",
192                    cl::desc("Realign stack if needed"),
193                    cl::init(true));
194
195 cl::opt<std::string>
196 TrapFuncName("trap-func", cl::Hidden,
197         cl::desc("Emit a call to trap function rather than a trap instruction"),
198         cl::init(""));
199
200 cl::opt<bool>
201 EnablePIE("enable-pie",
202           cl::desc("Assume the creation of a position independent executable."),
203           cl::init(false));
204
205 cl::opt<bool>
206 SegmentedStacks("segmented-stacks",
207                 cl::desc("Use segmented stacks if possible."),
208                 cl::init(false));
209
210 cl::opt<bool>
211 UseInitArray("use-init-array",
212              cl::desc("Use .init_array instead of .ctors."),
213              cl::init(false));
214
215 cl::opt<std::string> StopAfter("stop-after",
216                             cl::desc("Stop compilation after a specific pass"),
217                             cl::value_desc("pass-name"),
218                                       cl::init(""));
219 cl::opt<std::string> StartAfter("start-after",
220                           cl::desc("Resume compilation after a specific pass"),
221                           cl::value_desc("pass-name"),
222                           cl::init(""));
223
224 cl::opt<unsigned>
225 SSPBufferSize("stack-protector-buffer-size", cl::init(8),
226               cl::desc("Lower bound for a buffer to be considered for "
227                        "stack protection"));
228 #endif