blob: ebd7f36ffb1acc0069ac7ef80828d1a4dde51a7b [file] [log] [blame]
Zonr Changc383a502010-10-12 01:52:08 +08001/*
Stephen Hines5c25c512012-02-27 12:58:17 -08002 * Copyright 2010-2012, The Android Open Source Project
Zonr Changc383a502010-10-12 01:52:08 +08003 *
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 Liaob81c6a42010-10-10 14:15:00 -070017//===----------------------------------------------------------------------===//
18//
19// This file defines the options accepted by llvm-rs-cc.
20//
21//===----------------------------------------------------------------------===//
22
23// Include the common option parsing interfaces.
24include "clang/Driver/OptParser.td"
25
26//===----------------------------------------------------------------------===//
27// Target Options
28//===----------------------------------------------------------------------===//
29
Stephen Hines2e35b132011-07-22 02:50:19 -070030def target_api : Separate<"-target-api">,
31 HelpText<"Specify target API level (e.g. 14)">;
32def target_api_EQ : Joined<"-target-api=">, Alias<target_api>;
33
Shih-wei Liaob81c6a42010-10-10 14:15:00 -070034//===----------------------------------------------------------------------===//
35// Header Search Options
36//===----------------------------------------------------------------------===//
37
38def I : JoinedOrSeparate<"-I">, MetaVarName<"<directory>">,
39 HelpText<"Add directory to include search path">;
40def _I : Separate<"include-path">, MetaVarName<"<directory>">, Alias<I>;
41
42//===----------------------------------------------------------------------===//
43// Frontend Options
44//===----------------------------------------------------------------------===//
45
46def o : Separate<"-o">, MetaVarName<"<directory>">,
47 HelpText<"Specify output directory">;
48
49def Output_Type_Group : OptionGroup<"<output type group>">;
50let Group = Output_Type_Group in {
51
52def emit_asm : Flag<"-emit-asm">,
53 HelpText<"Emit target assembly files">;
54def _emit_asm : Flag<"-S">, Alias<emit_asm>;
55def emit_llvm : Flag<"-emit-llvm">,
56 HelpText<"Build ASTs then convert to LLVM, emit .ll file">;
57def emit_bc : Flag<"-emit-bc">,
58 HelpText<"Build ASTs then convert to LLVM, emit .bc file">;
59def emit_nothing : Flag<"-emit-nothing">,
60 HelpText<"Build ASTs then convert to LLVM, but emit nothing">;
61}
62
mkopec1c460b372012-01-09 11:21:50 -050063def emit_g : Flag<"-g">,
64 HelpText<"Emit LLVM Debug Metadata">;
65
66def optimization_level : Separate<"-O">, MetaVarName<"<optimization-level>">,
67 HelpText<"<optimization-level> can be one of '0' or '3' (default)">;
68
Shih-wei Liaob81c6a42010-10-10 14:15:00 -070069def allow_rs_prefix : Flag<"-allow-rs-prefix">,
70 HelpText<"Allow user-defined function prefixed with 'rs'">;
71
72def java_reflection_path_base : Separate<"-java-reflection-path-base">,
73 MetaVarName<"<directory>">,
74 HelpText<"Base directory for output reflected Java files">;
75def _java_reflection_path_base : Separate<"-p">,
76 Alias<java_reflection_path_base>;
77def java_reflection_package_name : Separate<"-java-reflection-package-name">,
78 HelpText<"Specify the package name that reflected Java files belong to">;
79def _java_reflection_package_name : Separate<"-j">,
80 Alias<java_reflection_package_name>;
81
82def bitcode_storage : Separate<"-bitcode-storage">,
83 MetaVarName<"<value>">, HelpText<"<value> should be 'ar' or 'jc'">;
84def _bitcode_storage : Separate<"-s">, Alias<bitcode_storage>;
85
Stephen Hines8f4d9722011-12-05 14:14:42 -080086def W : Joined<"-W">;
87def w : Flag<"-w">, HelpText<"Suppress all warnings">;
88
Shih-wei Liaob81c6a42010-10-10 14:15:00 -070089//===----------------------------------------------------------------------===//
90// Dependency Output Options
91//===----------------------------------------------------------------------===//
92
93def M_Group : OptionGroup<"M group>">;
94let Group = M_Group in {
95
96 def MD : Flag<"-MD">;
97
98 def M : Flag<"-M">;
99 def emit_dep : Flag<"-emit-dep">, Alias<M>;
100}
101
102def output_dep_dir : Separate<"-output-dep-dir">, MetaVarName<"<directory>">,
103 HelpText<"Specify output directory for dependencies output">;
104def _output_dep_dir : Separate<"-d">, Alias<output_dep_dir>;
105
Shih-wei Liaoffa58bb2010-10-10 14:15:13 -0700106def additional_dep_target: Separate<"-additional-dep-target">,
Shih-wei Liaob81c6a42010-10-10 14:15:00 -0700107 HelpText<"Additional targets to show up in dependencies output">;
108def _additional_dep_target : Separate<"-a">, Alias<additional_dep_target>;
109
110//===----------------------------------------------------------------------===//
Stephen Hines5c25c512012-02-27 12:58:17 -0800111// Reflection Options
112//===----------------------------------------------------------------------===//
113
114def reflect_cpp : Flag<"-reflect-c++">,
115 HelpText<"Reflect C++ classes">;
116
117//===----------------------------------------------------------------------===//
Shih-wei Liaob81c6a42010-10-10 14:15:00 -0700118// Misc Options
119//===----------------------------------------------------------------------===//
120
121def help : Flag<"-help">,
122 HelpText<"Print this help text">;
123def _help : Flag<"--help">, Alias<help>;
124def __help : Flag<"-h">, Alias<help>;
125
126def version : Flag<"-version">,
127 HelpText<"Print the assembler version">;
128def _version : Flag<"--version">, Alias<version>;
Shih-wei Liaoffa58bb2010-10-10 14:15:13 -0700129
130// Compatible with old slang
131def no_link : Flag<"-no-link">; // currently no effect