Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 3 | // This file defines the options accepted by llvm-rs-cc. |
| 4 | // |
| 5 | //===----------------------------------------------------------------------===// |
| 6 | |
| 7 | // Include the common option parsing interfaces. |
| 8 | include "clang/Driver/OptParser.td" |
| 9 | |
| 10 | //===----------------------------------------------------------------------===// |
| 11 | // Target Options |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | def target_cpu : Separate<"-target-cpu">, |
| 15 | HelpText<"Target a specific cpu type">; |
| 16 | def _target_cpu : Flag<"-u">, Alias<target_cpu>; |
| 17 | def target_feature : Separate<"-target-feature">, |
| 18 | HelpText<"Target specific attributes">; |
| 19 | def triple : Separate<"-triple">, |
| 20 | HelpText<"Specify target triple (e.g. i686-apple-darwin9)">; |
| 21 | def triple_EQ : Joined<"-triple=">, Alias<triple>; |
| 22 | def _triple : Separate<"-t">, Alias<triple>; |
| 23 | |
| 24 | //===----------------------------------------------------------------------===// |
| 25 | // Header Search Options |
| 26 | //===----------------------------------------------------------------------===// |
| 27 | |
| 28 | def I : JoinedOrSeparate<"-I">, MetaVarName<"<directory>">, |
| 29 | HelpText<"Add directory to include search path">; |
| 30 | def _I : Separate<"include-path">, MetaVarName<"<directory>">, Alias<I>; |
| 31 | |
| 32 | //===----------------------------------------------------------------------===// |
| 33 | // Frontend Options |
| 34 | //===----------------------------------------------------------------------===// |
| 35 | |
| 36 | def o : Separate<"-o">, MetaVarName<"<directory>">, |
| 37 | HelpText<"Specify output directory">; |
| 38 | |
| 39 | def Output_Type_Group : OptionGroup<"<output type group>">; |
| 40 | let Group = Output_Type_Group in { |
| 41 | |
| 42 | def emit_asm : Flag<"-emit-asm">, |
| 43 | HelpText<"Emit target assembly files">; |
| 44 | def _emit_asm : Flag<"-S">, Alias<emit_asm>; |
| 45 | def emit_llvm : Flag<"-emit-llvm">, |
| 46 | HelpText<"Build ASTs then convert to LLVM, emit .ll file">; |
| 47 | def emit_bc : Flag<"-emit-bc">, |
| 48 | HelpText<"Build ASTs then convert to LLVM, emit .bc file">; |
| 49 | def emit_nothing : Flag<"-emit-nothing">, |
| 50 | HelpText<"Build ASTs then convert to LLVM, but emit nothing">; |
| 51 | } |
| 52 | |
| 53 | def allow_rs_prefix : Flag<"-allow-rs-prefix">, |
| 54 | HelpText<"Allow user-defined function prefixed with 'rs'">; |
| 55 | |
| 56 | def java_reflection_path_base : Separate<"-java-reflection-path-base">, |
| 57 | MetaVarName<"<directory>">, |
| 58 | HelpText<"Base directory for output reflected Java files">; |
| 59 | def _java_reflection_path_base : Separate<"-p">, |
| 60 | Alias<java_reflection_path_base>; |
| 61 | def java_reflection_package_name : Separate<"-java-reflection-package-name">, |
| 62 | HelpText<"Specify the package name that reflected Java files belong to">; |
| 63 | def _java_reflection_package_name : Separate<"-j">, |
| 64 | Alias<java_reflection_package_name>; |
| 65 | |
| 66 | def bitcode_storage : Separate<"-bitcode-storage">, |
| 67 | MetaVarName<"<value>">, HelpText<"<value> should be 'ar' or 'jc'">; |
| 68 | def _bitcode_storage : Separate<"-s">, Alias<bitcode_storage>; |
| 69 | |
| 70 | //===----------------------------------------------------------------------===// |
| 71 | // Dependency Output Options |
| 72 | //===----------------------------------------------------------------------===// |
| 73 | |
| 74 | def M_Group : OptionGroup<"M group>">; |
| 75 | let Group = M_Group in { |
| 76 | |
| 77 | def MD : Flag<"-MD">; |
| 78 | |
| 79 | def M : Flag<"-M">; |
| 80 | def emit_dep : Flag<"-emit-dep">, Alias<M>; |
| 81 | } |
| 82 | |
| 83 | def output_dep_dir : Separate<"-output-dep-dir">, MetaVarName<"<directory>">, |
| 84 | HelpText<"Specify output directory for dependencies output">; |
| 85 | def _output_dep_dir : Separate<"-d">, Alias<output_dep_dir>; |
| 86 | |
Shih-wei Liao | ffa58bb | 2010-10-10 14:15:13 -0700 | [diff] [blame] | 87 | def additional_dep_target: Separate<"-additional-dep-target">, |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 88 | HelpText<"Additional targets to show up in dependencies output">; |
| 89 | def _additional_dep_target : Separate<"-a">, Alias<additional_dep_target>; |
| 90 | |
| 91 | //===----------------------------------------------------------------------===// |
| 92 | // Misc Options |
| 93 | //===----------------------------------------------------------------------===// |
| 94 | |
| 95 | def help : Flag<"-help">, |
| 96 | HelpText<"Print this help text">; |
| 97 | def _help : Flag<"--help">, Alias<help>; |
| 98 | def __help : Flag<"-h">, Alias<help>; |
| 99 | |
| 100 | def version : Flag<"-version">, |
| 101 | HelpText<"Print the assembler version">; |
| 102 | def _version : Flag<"--version">, Alias<version>; |
Shih-wei Liao | ffa58bb | 2010-10-10 14:15:13 -0700 | [diff] [blame] | 103 | |
| 104 | // Compatible with old slang |
| 105 | def no_link : Flag<"-no-link">; // currently no effect |