Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.62 KB | None | 0 0
  1. I suggest to implement the value completion which flags are handled in clang Driver.
  2. Some flags pass the value string directly to further process, which is too hard to chase and few people would use those flag.
  3. Eg. "clang foo.a -Wa,--foobar -o foo" will execute "as --foobar -o foo", and Driver has no information about --foobar.
  4.  
  5. I've researched flags which take a value as an argument.
  6. As you can see, there are some flags which includes .def files, and I think it's reasonable to merge its information to Options.td using tablegen.
  7.  
  8. Many of "No fixed value" flags were passing value "foobar" as string to further process or using it as a string.
  9.  
  10. * -analyze-function <value>
  11. it doesn't take fixed value
  12.  
  13. * -analyzer-checker <value>
  14. // We can have a list of comma separated checker names, e.g:
  15. // '-analyzer-checker=cocoa,unix'
  16. This is one example in CompilerInvocation.cpp, but it doesn't seem checking the value.
  17.  
  18. * -analyzer-config <value>
  19. // We can have a list of comma separated config names, e.g:
  20. // '-analyzer-config key1=val1,key2=val2'
  21. This is one example in CompilerInvocation.cpp, either.
  22.  
  23. * -analyzer-constraints <value>
  24. clang/StaticAnalyzer/Core/Analyses.def
  25.  
  26. * -analyzer-disable-checker <value>
  27. Same as -analyzer-checker. It doesn't take fixed value.
  28.  
  29. * -analyzer-inline-max-stack-depth <value>
  30. It takes integer (4 by default)
  31.  
  32. * -analyzer-inlining-mode <value>
  33. clang/StaticAnalyzer/Core/Analyses.def
  34.  
  35. * -analyzer-max-loop <value>
  36. It takes integer.
  37.  
  38. * -analyzer-output <value>
  39. clang/StaticAnalyzer/Core/Analyses.def
  40.  
  41. * -analyzer-purge <value>
  42. clang/StaticAnalyzer/Core/Analyses.def
  43.  
  44. * -analyzer-store <value>
  45. clang/StaticAnalyzer/Core/Analyses.def
  46.  
  47. * -arcmt-migrate-report-output <value>
  48. Seems it doesn't take fixed value.
  49.  
  50. * -aux-triple <value>
  51. for CUDA, I think...
  52.  
  53. * -backend-option <value>
  54. Seems it doesn't take fixed value.
  55.  
  56. * -cl-ext=<value>
  57. Support for OpenCL extensions.
  58. Seems it doesn't take fixed value?
  59.  
  60. * cl-std <value>
  61. ok
  62. // -cl-std only applies for OpenCL language standards.
  63. // Override the -std option in this case.
  64. if (const Arg *A = Args.getLastArg(OPT_cl_std_EQ)) {
  65. LangStandard::Kind OpenCLLangStd
  66. = llvm::StringSwitch<LangStandard::Kind>(A->getValue())
  67. .Cases("cl", "CL", LangStandard::lang_opencl10)
  68. .Cases("cl1.1", "CL1.1", LangStandard::lang_opencl11)
  69. .Cases("cl1.2", "CL1.2", LangStandard::lang_opencl12)
  70. .Cases("cl2.0", "CL2.0", LangStandard::lang_opencl20)
  71. .Default(LangStandard::lang_unspecified);
  72.  
  73. if (OpenCLLangStd == LangStandard::lang_unspecified) {
  74. Diags.Report(diag::err_drv_invalid_value)
  75. << A->getAsString(Args) << A->getValue();
  76. }
  77. else
  78. LangStd = OpenCLLangStd;
  79. }
  80.  
  81. * -coverage-data-file <value>
  82. No fixed value.
  83.  
  84. * -coverage-notes-file <value>
  85. No fixed value.
  86.  
  87. * -coverage-version=<value>
  88. 4bytes string.
  89. if (Args.hasArg(OPT_coverage_version_EQ)) {
  90. StringRef CoverageVersion = Args.getLastArgValue(OPT_coverage_version_EQ);
  91. if (CoverageVersion.size() != 4) {
  92. Diags.Report(diag::err_drv_invalid_value)
  93. << Args.getLastArg(OPT_coverage_version_EQ)->getAsString(Args)
  94. << CoverageVersion;
  95. } else {
  96. memcpy(Opts.CoverageVersion, CoverageVersion.data(), 4);
  97. }
  98. }
  99.  
  100. * -dependency-dot <value>
  101. No fixed value.
  102.  
  103. * -dependency-file <value>
  104. No fixed value.
  105.  
  106. * --dependent-lib=<value>
  107. No fixed value.
  108.  
  109. * -diagnostic-log-file <value>
  110. No fixed value.
  111.  
  112. * -dwarf-debug-flags <value>
  113. No fixed value.
  114.  
  115. * -D <macro>=<value>
  116. No fixed value.
  117.  
  118. * -error-on-deserialized-decl <value>
  119. No fixed value.
  120.  
  121. * -fbracket-depth <value>
  122. * -fconstexpr-depth <value>
  123. * -fconstexpr-steps <value>
  124. No fixed value.
  125.  
  126. * -fcuda-include-gpubinary <value>
  127. No fixed value.
  128.  
  129. * -fdebug-compilation-dir <value>
  130. No fixed value.
  131.  
  132. * -fdebug-prefix-map=<value>
  133. No fixed value.
  134.  
  135. * -fdefault-calling-conv=<value>
  136. ok
  137. // Check for MS default calling conventions being specified.
  138. if (Arg *A = Args.getLastArg(OPT_fdefault_calling_conv_EQ)) {
  139. LangOptions::DefaultCallingConvention DefaultCC =
  140. llvm::StringSwitch<LangOptions::DefaultCallingConvention>(
  141. A->getValue())
  142. .Case("cdecl", LangOptions::DCC_CDecl)
  143. .Case("fastcall", LangOptions::DCC_FastCall)
  144. .Case("stdcall", LangOptions::DCC_StdCall)
  145. .Case("vectorcall", LangOptions::DCC_VectorCall)
  146. .Default(LangOptions::DCC_None);
  147. if (DefaultCC == LangOptions::DCC_None)
  148. Diags.Report(diag::err_drv_invalid_value)
  149. << "-fdefault-calling-conv=" << A->getValue();
  150.  
  151. llvm::Triple T(TargetOpts.Triple);
  152. llvm::Triple::ArchType Arch = T.getArch();
  153. bool emitError = (DefaultCC == LangOptions::DCC_FastCall ||
  154. DefaultCC == LangOptions::DCC_StdCall) &&
  155. Arch != llvm::Triple::x86;
  156. emitError |= DefaultCC == LangOptions::DCC_VectorCall &&
  157. !(Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64);
  158. if (emitError)
  159. Diags.Report(diag::err_drv_argument_not_allowed_with)
  160. << A->getSpelling() << T.getTriple();
  161. else
  162. Opts.setDefaultCallingConv(DefaultCC);
  163. }
  164.  
  165. * -fdiagnostics-format <value>
  166. ok
  167. StringRef Format =
  168. Args.getLastArgValue(OPT_fdiagnostics_format, "clang");
  169. if (Format == "clang")
  170. Opts.setFormat(DiagnosticOptions::Clang);
  171. else if (Format == "msvc")
  172. Opts.setFormat(DiagnosticOptions::MSVC);
  173. else if (Format == "msvc-fallback") {
  174. Opts.setFormat(DiagnosticOptions::MSVC);
  175. Opts.CLFallbackMode = true;
  176. } else if (Format == "vi")
  177. Opts.setFormat(DiagnosticOptions::Vi);
  178. else {
  179. Success = false;
  180. if (Diags)
  181. Diags->Report(diag::err_drv_invalid_value)
  182. << Args.getLastArg(OPT_fdiagnostics_format)->getAsString(Args)
  183. << Format;
  184. }
  185.  
  186. * -fdiagnostics-show-category <value>
  187. ok
  188. StringRef ShowCategory =
  189. Args.getLastArgValue(OPT_fdiagnostics_show_category, "none");
  190. if (ShowCategory == "none")
  191. Opts.ShowCategories = 0;
  192. else if (ShowCategory == "id")
  193. Opts.ShowCategories = 1;
  194. else if (ShowCategory == "name")
  195. Opts.ShowCategories = 2;
  196. else {
  197. Success = false;
  198. if (Diags)
  199. Diags->Report(diag::err_drv_invalid_value)
  200. << Args.getLastArg(OPT_fdiagnostics_show_category)->getAsString(Args)
  201. << ShowCategory;
  202. }
  203.  
  204. * -ffp-contract=<value>
  205. ok
  206. if (Arg *A = Args.getLastArg(OPT_ffp_contract)) {
  207. StringRef Val = A->getValue();
  208. if (Val == "fast")
  209. Opts.setDefaultFPContractMode(LangOptions::FPC_Fast);
  210. else if (Val == "on")
  211. Opts.setDefaultFPContractMode(LangOptions::FPC_On);
  212. else if (Val == "off")
  213. Opts.setDefaultFPContractMode(LangOptions::FPC_Off);
  214. else
  215. Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Val;
  216. }
  217.  
  218. * -find-pch-source=<value>
  219. No fixed value.
  220.  
  221. * -fixit=<value>
  222. No fixed value.
  223.  
  224. * -flto-jobs=<value>
  225. It takes integer
  226.  
  227. * -flto=<value>
  228. ok
  229. Set LTO mode to either 'full' or 'thin'
  230. Opts.PrepareForLTO = Args.hasArg(OPT_flto, OPT_flto_EQ);
  231. const Arg *A = Args.getLastArg(OPT_flto, OPT_flto_EQ);
  232. Opts.EmitSummaryIndex = A && A->containsValue("thin");
  233. Opts.LTOUnit = Args.hasFlag(OPT_flto_unit, OPT_fno_lto_unit, false);
  234. if (Arg *A = Args.getLastArg(OPT_fthinlto_index_EQ)) {
  235. if (IK.getLanguage() != InputKind::LLVM_IR)
  236. Diags.Report(diag::err_drv_argument_only_allowed_with)
  237. << A->getAsString(Args) << "-x ir";
  238. Opts.ThinLTOIndexFile = Args.getLastArgValue(OPT_fthinlto_index_EQ);
  239. }
  240.  
  241. * -fmax-type-align=<value>
  242. No fixed value.
  243.  
  244. * -fmodule-format=<value>
  245. Select the container format for clang modules and PCH. Supported options are 'raw' and 'obj'.
  246.  
  247. * -fmodules-embed-all-files<value>
  248. It takes file which exists.
  249.  
  250. * -fmodules-ignore-macro=<value>
  251. No fixed value.
  252.  
  253. * -fms-compatibility-version=<value>
  254. No fixed value.
  255.  
  256. * -fno-builtin-<value>
  257. No fixed value.
  258.  
  259. * -fsanitize-coverage=<value>
  260. * -fno-sanitize-coverage=<value>
  261. ok
  262. int parseCoverageFeatures(const Driver &D, const llvm::opt::Arg *A) {
  263. assert(A->getOption().matches(options::OPT_fsanitize_coverage) ||
  264. A->getOption().matches(options::OPT_fno_sanitize_coverage));
  265. int Features = 0;
  266. for (int i = 0, n = A->getNumValues(); i != n; ++i) {
  267. const char *Value = A->getValue(i);
  268. int F = llvm::StringSwitch<int>(Value)
  269. .Case("func", CoverageFunc)
  270. .Case("bb", CoverageBB)
  271. .Case("edge", CoverageEdge)
  272. .Case("indirect-calls", CoverageIndirCall)
  273. .Case("trace-bb", CoverageTraceBB)
  274. .Case("trace-cmp", CoverageTraceCmp)
  275. .Case("trace-div", CoverageTraceDiv)
  276. .Case("trace-gep", CoverageTraceGep)
  277. .Case("8bit-counters", Coverage8bitCounters)
  278. .Case("trace-pc", CoverageTracePC)
  279. .Case("trace-pc-guard", CoverageTracePCGuard)
  280. .Case("no-prune", CoverageNoPrune)
  281. .Case("inline-8bit-counters", CoverageInline8bitCounters)
  282. .Default(0);
  283. if (F == 0)
  284. D.Diag(clang::diag::err_drv_unsupported_option_argument)
  285. << A->getOption().getName() << Value;
  286. Features |= F;
  287. }
  288. return Features;
  289. }
  290.  
  291. * -fno-sanitize-recover=<value>
  292. } else if (Arg->getOption().matches(options::OPT_fno_sanitize_recover)) {
  293. DeprecatedReplacement = "-fno-sanitize-recover=undefined,integer' or "
  294. "'-fno-sanitize-recover=all";
  295.  
  296. * -fno-sanitize-trap=<value>
  297. No fixed value.
  298.  
  299. * -fobjc-arc-cxxlib=<value>
  300.  
  301. if (Arg *A = Args.getLastArg(OPT_fobjc_arc_cxxlib_EQ)) {
  302. ok
  303. StringRef Name = A->getValue();
  304. unsigned Library = llvm::StringSwitch<unsigned>(Name)
  305. .Case("libc++", ARCXX_libcxx)
  306. .Case("libstdc++", ARCXX_libstdcxx)
  307. .Case("none", ARCXX_nolib)
  308. .Default(~0U);
  309. if (Library == ~0U)
  310. Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Name;
  311. else
  312. Opts.ObjCXXARCStandardLibrary = (ObjCXXARCStandardLibraryKind)Library;
  313. }
  314.  
  315. * -fobjc-dispatch-method=<value>
  316. ok
  317. if (Arg *A = Args.getLastArg(OPT_fobjc_dispatch_method_EQ)) {
  318. StringRef Name = A->getValue();
  319. unsigned Method = llvm::StringSwitch<unsigned>(Name)
  320. .Case("legacy", CodeGenOptions::Legacy)
  321. .Case("non-legacy", CodeGenOptions::NonLegacy)
  322. .Case("mixed", CodeGenOptions::Mixed)
  323. .Default(~0U);
  324. if (Method == ~0U) {
  325. Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Name;
  326. Success = false;
  327. } else {
  328. Opts.setObjCDispatchMethod(
  329. static_cast<CodeGenOptions::ObjCDispatchMethodKind>(Method));
  330. }
  331. }
  332.  
  333. * -fobjc-runtime=<value>
  334. No fixed value.
  335.  
  336. * -fopenmp-host-ir-file-path <value>
  337. No fixed value.
  338.  
  339. * -fopenmp-targets=<value>
  340. No fixed value.
  341.  
  342. * -foperator-arrow-depth <value>
  343. No fixed value.
  344.  
  345. * -foverride-record-layout=<value>
  346. No fixed value.
  347.  
  348. * -fpack-struct=<value> Specify the default maximum struct packing alignment
  349. Seems it take integer.
  350.  
  351. * -fprofile-instrument-path=<value>
  352. No fixed value.
  353.  
  354. * -fprofile-instrument-use-path=<value>
  355. No fixed value.
  356.  
  357. * -fprofile-instrument=<value>
  358. ok
  359. static void setPGOInstrumentor(CodeGenOptions &Opts, ArgList &Args,
  360. DiagnosticsEngine &Diags) {
  361. Arg *A = Args.getLastArg(OPT_fprofile_instrument_EQ);
  362. if (A == nullptr)
  363. return;
  364. StringRef S = A->getValue();
  365. unsigned I = llvm::StringSwitch<unsigned>(S)
  366. .Case("none", CodeGenOptions::ProfileNone)
  367. .Case("clang", CodeGenOptions::ProfileClangInstr)
  368. .Case("llvm", CodeGenOptions::ProfileIRInstr)
  369. .Default(~0U);
  370.  
  371. * -fprofile-sample-use=<value>
  372. No fixed value.
  373.  
  374. * -fsanitize-address-field-padding=<value>
  375. Seems it take integer.
  376.  
  377. * -fsanitize-blacklist=<value>
  378. No fixed value.
  379.  
  380. * -fsanitize-coverage-type=<value>
  381. Seems it take integer.
  382.  
  383. * -fsanitize-memory-track-origins=<value>
  384. Seems it take integer.
  385.  
  386. * -fsanitize-recover=<value>
  387. No fixed value.
  388.  
  389. * -fsanitize-trap=<value> Enable trapping for specified sanitizers
  390. No fixed value.
  391.  
  392. * -fshort-enums
  393. No fixed value.
  394.  
  395. * -fshow-overloads=<value>
  396. ok
  397. ok
  398. StringRef ShowOverloads =
  399. Args.getLastArgValue(OPT_fshow_overloads_EQ, "all");
  400. if (ShowOverloads == "best")
  401. Opts.setShowOverloads(Ovl_Best);
  402. else if (ShowOverloads == "all")
  403. Opts.setShowOverloads(Ovl_All);
  404. else {
  405. Success = false;
  406. if (Diags)
  407. Diags->Report(diag::err_drv_invalid_value)
  408. << Args.getLastArg(OPT_fshow_overloads_EQ)->getAsString(Args)
  409. << ShowOverloads;
  410. }
  411.  
  412. * -fstrict-enums Enable optimizations based on the strict definition of an enum's value range
  413. No fixed value.
  414.  
  415. * -ftemplate-depth <value>
  416. Seems it take integer.
  417.  
  418. * -ftest-module-file-extension=<value>
  419. No fixed value.
  420.  
  421. * -fthin-link-bitcode=<value>
  422. No fixed value.
  423.  
  424. * -fthinlto-index=<value> Perform ThinLTO importing using provided function summary index
  425. No fixed value.
  426.  
  427. * -ftrap-function=<value> Issue call to specified function rather than a trap instruction
  428. No fixed value.
  429.  
  430. * -ftype-visibility <value>
  431. No fixed value.
  432.  
  433. * -fveclib=<value> Use the given vector functions library
  434. ok
  435. if (Arg *A = Args.getLastArg(OPT_fveclib)) {
  436. StringRef Name = A->getValue();
  437. if (Name == "Accelerate")
  438. Opts.setVecLib(CodeGenOptions::Accelerate);
  439. else if (Name == "SVML")
  440. Opts.setVecLib(CodeGenOptions::SVML);
  441. else if (Name == "none")
  442. Opts.setVecLib(CodeGenOptions::NoLibrary);
  443. else
  444. Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Name;
  445. }
  446.  
  447. * -fvisibility <value> Default type and symbol visibility
  448. ok
  449. // -fvisibility= and -fvisibility-ms-compat are of a piece.
  450. if (const Arg *A = Args.getLastArg(options::OPT_fvisibility_EQ,
  451. options::OPT_fvisibility_ms_compat)) {
  452. if (A->getOption().matches(options::OPT_fvisibility_EQ)) {
  453. CmdArgs.push_back("-fvisibility");
  454. CmdArgs.push_back(A->getValue());
  455. } else {
  456. assert(A->getOption().matches(options::OPT_fvisibility_ms_compat));
  457. CmdArgs.push_back("-fvisibility");
  458. CmdArgs.push_back("hidden");
  459. CmdArgs.push_back("-ftype-visibility");
  460. CmdArgs.push_back("default");
  461. }
  462. }
  463. * -fxray-always-instrument= <value>
  464. Expect filenames.
  465.  
  466. * -fxray-instruction-threshold= <value>
  467. No fixed value.
  468.  
  469. * -fxray-never-instrument= <value>
  470. Expect filenames.
  471.  
  472. * -F <value> Add directory to framework include search path
  473. Expect path.
  474.  
  475. * -header-include-file <value>
  476. No fixed value.
  477.  
  478. * -idirafter <value> Add directory to AFTER include search path
  479. no fixed value.
  480.  
  481. * -iframework <value> Add directory to SYSTEM framework search path
  482. no fixed value.
  483.  
  484. * -ivfsoverlay <value> Overlay the virtual filesystem described by file over the real file system
  485. no fixed value.
  486.  
  487. * --linker-option=<value> Add linker option
  488. no fixed value.
  489.  
  490. * -main-file-name <value> Main file name to use for debug info
  491. no fixed value.
  492.  
  493. * -mcode-model <value> The code model to use
  494. ok
  495. static StringRef getCodeModel(ArgList &Args, DiagnosticsEngine &Diags) {
  496. if (Arg *A = Args.getLastArg(OPT_mcode_model)) {
  497. StringRef Value = A->getValue();
  498. if (Value == "small" || Value == "kernel" || Value == "medium" ||
  499. Value == "large")
  500. return Value;
  501. Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Value;
  502. }
  503. return "default";
  504. }
  505.  
  506. * -mdebug-pass <value> Enable additional debug output
  507. no fixed value.
  508.  
  509. * -meabi <value> Set EABI type, e.g. 4, 5 or gnu (default depends on triple)
  510. ok
  511. Opts.ABI = Args.getLastArgValue(OPT_target_abi);
  512. if (Arg *A = Args.getLastArg(OPT_meabi)) {
  513. StringRef Value = A->getValue();
  514. llvm::EABI EABIVersion = llvm::StringSwitch<llvm::EABI>(Value)
  515. .Case("default", llvm::EABI::Default)
  516. .Case("4", llvm::EABI::EABI4)
  517. .Case("5", llvm::EABI::EABI5)
  518. .Case("gnu", llvm::EABI::GNU)
  519. .Default(llvm::EABI::Unknown);
  520. if (EABIVersion == llvm::EABI::Unknown)
  521. Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args)
  522. << Value;
  523. else
  524. Opts.EABIVersion = Value;
  525. }
  526.  
  527. * -mfloat-abi <value> The float ABI to use
  528. ok
  529. hard or soft.
  530. switch (arm::getARMFloatABI(getToolChain(), Args)) {
  531. case arm::FloatABI::Invalid: llvm_unreachable("must have an ABI!");
  532. case arm::FloatABI::Soft:
  533. CmdArgs.push_back(Args.MakeArgString("-mfloat-abi=soft"));
  534. break;
  535. case arm::FloatABI::SoftFP:
  536. CmdArgs.push_back(Args.MakeArgString("-mfloat-abi=softfp"));
  537. break;
  538. case arm::FloatABI::Hard:
  539. CmdArgs.push_back(Args.MakeArgString("-mfloat-abi=hard"));
  540. break;
  541. }
  542.  
  543. * -mfpmath <value> Which unit to use for fp math
  544. No fixed value.
  545.  
  546. * -mlimit-float-precision <value>
  547. No fixed value.
  548.  
  549. * -mlink-bitcode-file <value>
  550. No fixed value. Takes files?
  551.  
  552. * -mlink-cuda-bitcode <value>
  553. No fixed value. Takes files?
  554.  
  555. * -mllvm <value> Additional arguments to forward to LLVM's option processing
  556. No fixed value. This is option for LLVM?
  557.  
  558. * -module-dependency-dir <value>
  559. No fixed value.
  560.  
  561. * -MQ <value> Specify name of main file output to quote in depfile
  562. No fixed value. Takes files?
  563.  
  564. * -mregparm <value> Limit the number of registers available for integer arguments
  565. No fixed value. Takes integers?
  566.  
  567. * -mrelocation-model <value>
  568. ok
  569. static StringRef getRelocModel(ArgList &Args, DiagnosticsEngine &Diags) {
  570. if (Arg *A = Args.getLastArg(OPT_mrelocation_model)) {
  571. StringRef Value = A->getValue();
  572. if (Value == "static" || Value == "pic" || Value == "ropi" ||
  573. Value == "rwpi" || Value == "ropi-rwpi" || Value == "dynamic-no-pic")
  574. return Value;
  575. Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Value;
  576. }
  577. return "pic";
  578. }
  579.  
  580. * -mstack-alignment=<value>
  581. Seems it takes integer.
  582.  
  583. * -mstack-probe-size=<value>
  584. Seems it takes integer.
  585.  
  586. * -mt-migrate-directory <value>
  587. No fixed value. Path?
  588.  
  589. * -mthread-model <value> The thread model to use, e.g. posix, single (posix by default)
  590. ok
  591. Opts.ThreadModel = Args.getLastArgValue(OPT_mthread_model, "posix");
  592. if (Opts.ThreadModel != "posix" && Opts.ThreadModel != "single")
  593. Diags.Report(diag::err_drv_invalid_value)
  594. << Args.getLastArg(OPT_mthread_model)->getAsString(Args)
  595. << Opts.ThreadModel;
  596.  
  597. * -MT <value> Specify name of main file output in depfile
  598. No fixed value. Files?
  599.  
  600. * -objcmt-whitelist-dir-path=<value>
  601. No fixed value. Path?
  602.  
  603. * -opt-record-file <value>
  604. No fixed value. Files?
  605.  
  606. * -pic-level <value> Value for __PIC__
  607. No fixed value.
  608.  
  609. * -preamble-bytes=<value> Assume that the precompiled header is a precompiled preamble covering the first N bytes of the main file
  610. No fixed value. Seems it takes int,int
  611.  
  612. * -resource-dir <value> The directory which holds the compiler resource files
  613. No fixed value. Takes Path.
  614.  
  615. * -Rpass-analysis=<value> Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
  616. No fixed value.
  617.  
  618. * -Rpass-missed=<value> Report missed transformations by optimization passes whose name matches the given POSIX regular expression
  619. No fixed value.
  620.  
  621. * -Rpass=<value> Report transformations performed by optimization passes whose name matches the given POSIX regular expression
  622. No fixed value.
  623.  
  624. * -split-dwarf-file <value>
  625. No fixed value. Takes File.
  626.  
  627. * -stack-protector-buffer-size <value>
  628. No fixed value. Takes int.
  629.  
  630. * -stack-protector <value>
  631. No fixed value. Takes int.
  632.  
  633. * -stats-file=<value> Filename to write statistics to
  634. No fixed value. Takes File.
  635.  
  636. * -std=<value> Language standard to compile for
  637. clang/Frontend/LangStandards.def
  638.  
  639. * -stdlib=<value> C++ standard library to use
  640. ToolChain::CXXStdlibType ToolChain::GetCXXStdlibType(const ArgList &Args) const{
  641. const Arg *A = Args.getLastArg(options::OPT_stdlib_EQ);
  642. StringRef LibName = A ? A->getValue() : CLANG_DEFAULT_CXX_STDLIB;
  643.  
  644. // Only use "platform" in tests to override CLANG_DEFAULT_CXX_STDLIB!
  645. if (LibName == "libc++")
  646. return ToolChain::CST_Libcxx;
  647. else if (LibName == "libstdc++")
  648. return ToolChain::CST_Libstdcxx;
  649. else if (LibName == "platform")
  650. return GetDefaultCXXStdlibType();
  651.  
  652. if (A)
  653. getDriver().Diag(diag::err_drv_invalid_stdlib_name) << A->getAsString(Args);
  654.  
  655. return GetDefaultCXXStdlibType();
  656. }
  657.  
  658. * -target-abi <value> Target a particular ABI type
  659. ok
  660. Opts.ABI = Args.getLastArgValue(OPT_target_abi);
  661.  
  662. * -target-cpu <value> Target a specific cpu type
  663. No fixed value. Takes cpu.
  664.  
  665. * -target-feature <value> Target specific attributes
  666. No fixed value.
  667.  
  668. * -target-linker-version <value>
  669. No fixed value.
  670.  
  671. * -triple <value> Specify target triple (e.g. i686-apple-darwin9)
  672. Very hard to implement this.
  673.  
  674. * -verify-ignore-unexpected=<value>
  675. No fixed value.
  676.  
  677. * -vtordisp-mode=<value> Control vtordisp placement on win32 targets
  678. No fixed value. Takes int.
  679.  
  680. * -working-directory <value>
  681. No fixed value. Path?
  682.  
  683. * -W<warnings>
  684. complete possible warnings
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement