Zonr Chang | c383a50 | 2010-10-12 01:52:08 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2010, The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 17 | //===----------------------------------------------------------------------===// |
| 18 | // |
| 19 | // This file defines the options accepted by llvm-rs-cc. |
| 20 | // |
| 21 | //===----------------------------------------------------------------------===// |
| 22 | |
| 23 | // Include the common option parsing interfaces. |
| 24 | include "clang/Driver/OptParser.td" |
| 25 | |
| 26 | //===----------------------------------------------------------------------===// |
| 27 | // Target Options |
| 28 | //===----------------------------------------------------------------------===// |
| 29 | |
| 30 | def target_cpu : Separate<"-target-cpu">, |
| 31 | HelpText<"Target a specific cpu type">; |
| 32 | def _target_cpu : Flag<"-u">, Alias<target_cpu>; |
| 33 | def target_feature : Separate<"-target-feature">, |
| 34 | HelpText<"Target specific attributes">; |
| 35 | def triple : Separate<"-triple">, |
| 36 | HelpText<"Specify target triple (e.g. i686-apple-darwin9)">; |
| 37 | def triple_EQ : Joined<"-triple=">, Alias<triple>; |
| 38 | def _triple : Separate<"-t">, Alias<triple>; |
| 39 | |
| 40 | //===----------------------------------------------------------------------===// |
| 41 | // Header Search Options |
| 42 | //===----------------------------------------------------------------------===// |
| 43 | |
| 44 | def I : JoinedOrSeparate<"-I">, MetaVarName<"<directory>">, |
| 45 | HelpText<"Add directory to include search path">; |
| 46 | def _I : Separate<"include-path">, MetaVarName<"<directory>">, Alias<I>; |
| 47 | |
| 48 | //===----------------------------------------------------------------------===// |
| 49 | // Frontend Options |
| 50 | //===----------------------------------------------------------------------===// |
| 51 | |
| 52 | def o : Separate<"-o">, MetaVarName<"<directory>">, |
| 53 | HelpText<"Specify output directory">; |
| 54 | |
| 55 | def Output_Type_Group : OptionGroup<"<output type group>">; |
| 56 | let Group = Output_Type_Group in { |
| 57 | |
| 58 | def emit_asm : Flag<"-emit-asm">, |
| 59 | HelpText<"Emit target assembly files">; |
| 60 | def _emit_asm : Flag<"-S">, Alias<emit_asm>; |
| 61 | def emit_llvm : Flag<"-emit-llvm">, |
| 62 | HelpText<"Build ASTs then convert to LLVM, emit .ll file">; |
| 63 | def emit_bc : Flag<"-emit-bc">, |
| 64 | HelpText<"Build ASTs then convert to LLVM, emit .bc file">; |
| 65 | def emit_nothing : Flag<"-emit-nothing">, |
| 66 | HelpText<"Build ASTs then convert to LLVM, but emit nothing">; |
| 67 | } |
| 68 | |
| 69 | def allow_rs_prefix : Flag<"-allow-rs-prefix">, |
| 70 | HelpText<"Allow user-defined function prefixed with 'rs'">; |
| 71 | |
| 72 | def java_reflection_path_base : Separate<"-java-reflection-path-base">, |
| 73 | MetaVarName<"<directory>">, |
| 74 | HelpText<"Base directory for output reflected Java files">; |
| 75 | def _java_reflection_path_base : Separate<"-p">, |
| 76 | Alias<java_reflection_path_base>; |
| 77 | def java_reflection_package_name : Separate<"-java-reflection-package-name">, |
| 78 | HelpText<"Specify the package name that reflected Java files belong to">; |
| 79 | def _java_reflection_package_name : Separate<"-j">, |
| 80 | Alias<java_reflection_package_name>; |
| 81 | |
| 82 | def bitcode_storage : Separate<"-bitcode-storage">, |
| 83 | MetaVarName<"<value>">, HelpText<"<value> should be 'ar' or 'jc'">; |
| 84 | def _bitcode_storage : Separate<"-s">, Alias<bitcode_storage>; |
| 85 | |
| 86 | //===----------------------------------------------------------------------===// |
| 87 | // Dependency Output Options |
| 88 | //===----------------------------------------------------------------------===// |
| 89 | |
| 90 | def M_Group : OptionGroup<"M group>">; |
| 91 | let Group = M_Group in { |
| 92 | |
| 93 | def MD : Flag<"-MD">; |
| 94 | |
| 95 | def M : Flag<"-M">; |
| 96 | def emit_dep : Flag<"-emit-dep">, Alias<M>; |
| 97 | } |
| 98 | |
| 99 | def output_dep_dir : Separate<"-output-dep-dir">, MetaVarName<"<directory>">, |
| 100 | HelpText<"Specify output directory for dependencies output">; |
| 101 | def _output_dep_dir : Separate<"-d">, Alias<output_dep_dir>; |
| 102 | |
Shih-wei Liao | ffa58bb | 2010-10-10 14:15:13 -0700 | [diff] [blame] | 103 | def additional_dep_target: Separate<"-additional-dep-target">, |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 104 | HelpText<"Additional targets to show up in dependencies output">; |
| 105 | def _additional_dep_target : Separate<"-a">, Alias<additional_dep_target>; |
| 106 | |
| 107 | //===----------------------------------------------------------------------===// |
| 108 | // Misc Options |
| 109 | //===----------------------------------------------------------------------===// |
| 110 | |
| 111 | def help : Flag<"-help">, |
| 112 | HelpText<"Print this help text">; |
| 113 | def _help : Flag<"--help">, Alias<help>; |
| 114 | def __help : Flag<"-h">, Alias<help>; |
| 115 | |
| 116 | def version : Flag<"-version">, |
| 117 | HelpText<"Print the assembler version">; |
| 118 | def _version : Flag<"--version">, Alias<version>; |
Shih-wei Liao | ffa58bb | 2010-10-10 14:15:13 -0700 | [diff] [blame] | 119 | |
| 120 | // Compatible with old slang |
| 121 | def no_link : Flag<"-no-link">; // currently no effect |