1 //===-- CommandFlags.h - Register Coalescing Interface ----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
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
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_CODEGEN_COMMAND_LINE_FLAGS_H
17 #define LLVM_CODEGEN_COMMAND_LINE_FLAGS_H
19 #include "llvm/Support/CommandLine.h"
20 #include "llvm/Support/CodeGen.h"
21 #include "llvm/Target/TargetMachine.h"
27 MArch("march", cl::desc("Architecture to generate code for (see --version)"));
31 cl::desc("Target a specific cpu type (-mcpu=help for details)"),
32 cl::value_desc("cpu-name"),
38 cl::desc("Target specific attributes (-mattr=help for details)"),
39 cl::value_desc("a1,+a2,-a3,..."));
42 RelocModel("relocation-model",
43 cl::desc("Choose relocation model"),
44 cl::init(Reloc::Default),
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"),
56 cl::opt<llvm::CodeModel::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",
64 clEnumValN(CodeModel::Kernel, "kernel",
66 clEnumValN(CodeModel::Medium, "medium",
68 clEnumValN(CodeModel::Large, "large",
73 RelaxAll("mc-relax-all",
74 cl::desc("When used with filetype=obj, "
75 "relax all fixups in the emitted object file"));
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):"),
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"),
89 cl::opt<bool> DisableDotLoc("disable-dot-loc", cl::Hidden,
90 cl::desc("Do not use .loc entries"));
92 cl::opt<bool> DisableCFI("disable-cfi", cl::Hidden,
93 cl::desc("Do not use .cfi_* directives"));
95 cl::opt<bool> EnableDwarfDirectory("enable-dwarf-directory", cl::Hidden,
96 cl::desc("Use .file directives with an explicit directory."));
99 DisableRedZone("disable-red-zone",
100 cl::desc("Do not emit code that uses the red zone."),
104 EnableFPMAD("enable-fp-mad",
105 cl::desc("Enable less precise MAD instructions to be generated"),
109 DisableFPElim("disable-fp-elim",
110 cl::desc("Disable frame pointer elimination optimization"),
114 DisableFPElimNonLeaf("disable-non-leaf-fp-elim",
115 cl::desc("Disable frame pointer elimination optimization for non-leaf funcs"),
119 EnableUnsafeFPMath("enable-unsafe-fp-math",
120 cl::desc("Enable optimizations that may decrease FP precision"),
124 EnableNoInfsFPMath("enable-no-infs-fp-math",
125 cl::desc("Enable FP math optimizations that assume no +-Infs"),
129 EnableNoNaNsFPMath("enable-no-nans-fp-math",
130 cl::desc("Enable FP math optimizations that assume no NaNs"),
134 EnableHonorSignDependentRoundingFPMath("enable-sign-dependent-rounding-fp-math",
136 cl::desc("Force codegen to assume rounding mode can change dynamically"),
140 GenerateSoftFloatCalls("soft-float",
141 cl::desc("Generate software floating point library calls"),
144 cl::opt<llvm::FloatABI::ABIType>
145 FloatABIForCalls("float-abi",
146 cl::desc("Choose float ABI type"),
147 cl::init(FloatABI::Default),
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)"),
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),
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."),
171 DontPlaceZerosInBSS("nozero-initialized-in-bss",
172 cl::desc("Don't place zero-initialized symbols into bss section"),
176 EnableGuaranteedTailCallOpt("tailcallopt",
177 cl::desc("Turn fastcc calls into tail calls by (potentially) changing ABI."),
181 DisableTailCalls("disable-tail-calls",
182 cl::desc("Never emit tail calls"),
186 OverrideStackAlignment("stack-alignment",
187 cl::desc("Override default stack alignment"),
191 EnableRealignStack("realign-stack",
192 cl::desc("Realign stack if needed"),
196 TrapFuncName("trap-func", cl::Hidden,
197 cl::desc("Emit a call to trap function rather than a trap instruction"),
201 EnablePIE("enable-pie",
202 cl::desc("Assume the creation of a position independent executable."),
206 SegmentedStacks("segmented-stacks",
207 cl::desc("Use segmented stacks if possible."),
211 UseInitArray("use-init-array",
212 cl::desc("Use .init_array instead of .ctors."),
215 cl::opt<std::string> StopAfter("stop-after",
216 cl::desc("Stop compilation after a specific pass"),
217 cl::value_desc("pass-name"),
219 cl::opt<std::string> StartAfter("start-after",
220 cl::desc("Resume compilation after a specific pass"),
221 cl::value_desc("pass-name"),
225 SSPBufferSize("stack-protector-buffer-size", cl::init(8),
226 cl::desc("Lower bound for a buffer to be considered for "
227 "stack protection"));