Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

227 lines
8.4 KiB

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