aboutsummaryrefslogtreecommitdiffstats
path: root/RSCCOptions.td
blob: 96cdaa8377fbdb4af8225d10360bcf797bf7a895 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/*
 * Copyright 2010-2012, The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

//===----------------------------------------------------------------------===//
//
//  This file defines the options accepted by llvm-rs-cc.
//
//===----------------------------------------------------------------------===//

// Include the common option parsing interfaces.
include "llvm/Option/OptParser.td"

//===----------------------------------------------------------------------===//
// Target Options
//===----------------------------------------------------------------------===//

def target_api : Separate<["-"], "target-api">,
  HelpText<"Specify target API level (e.g. 14)">;
def target_api_EQ : Joined<["-"], "target-api=">, Alias<target_api>;

//===----------------------------------------------------------------------===//
// Header Search Options
//===----------------------------------------------------------------------===//

def I : JoinedOrSeparate<["-"], "I">, MetaVarName<"<directory>">,
  HelpText<"Add directory to include search path">;
def _I : Separate<["-", "--"], "include-path">, MetaVarName<"<directory>">, Alias<I>;

//===----------------------------------------------------------------------===//
// Frontend Options
//===----------------------------------------------------------------------===//

def o : Separate<["-"], "o">, MetaVarName<"<directory>">,
  HelpText<"Specify output directory">;

def Output_Type_Group : OptionGroup<"<output type group>">;
let Group = Output_Type_Group in {

def emit_asm : Flag<["-"], "emit-asm">,
  HelpText<"Emit target assembly files">;
def _emit_asm : Flag<["-"], "S">, Alias<emit_asm>;
def emit_llvm : Flag<["-"], "emit-llvm">,
  HelpText<"Build ASTs then convert to LLVM, emit .ll file">;
def emit_bc : Flag<["-"], "emit-bc">,
  HelpText<"Build ASTs then convert to LLVM, emit .bc file">;
def emit_nothing : Flag<["-"], "emit-nothing">,
  HelpText<"Build ASTs then convert to LLVM, but emit nothing">;
}

def m32 : Flag<["-"], "m32">, HelpText<"Emit 32-bit C++ code">;
def m64 : Flag<["-"], "m64">, HelpText<"Emit 64-bit C++ code">;

def emit_g : Flag<["-"], "g">,
  HelpText<"Emit LLVM Debug Metadata">;

def optimization_level : JoinedOrSeparate<["-"], "O">, MetaVarName<"<optimization-level>">,
  HelpText<"<optimization-level> can be one of '0' or '3' (default)">;

def allow_rs_prefix : Flag<["-"], "allow-rs-prefix">,
  HelpText<"Allow user-defined function prefixed with 'rs'">;

def java_reflection_path_base : Separate<["-"], "java-reflection-path-base">,
  MetaVarName<"<directory>">,
  HelpText<"Base directory for output reflected Java files">;
def _java_reflection_path_base : Separate<["-"], "p">,
  Alias<java_reflection_path_base>;
def java_reflection_package_name : Separate<["-"], "java-reflection-package-name">,
  HelpText<"Specify the package name that reflected Java files belong to">;
def _java_reflection_package_name : Separate<["-"], "j">,
  Alias<java_reflection_package_name>;

def bitcode_storage : Separate<["-"], "bitcode-storage">,
  MetaVarName<"<value>">, HelpText<"<value> should be 'ar' or 'jc'">;
def _bitcode_storage : Separate<["-"], "s">, Alias<bitcode_storage>;

def rs_package_name : Separate<["-"], "rs-package-name">,
  MetaVarName<"<package_name>">,
  HelpText<"package name for referencing RS classes">;
def rs_package_name_EQ : Joined<["-"], "rs-package-name=">, Alias<rs_package_name>;

def W : Joined<["-"], "W">, HelpText<"Enable the specified warning">;
def w : Flag<["-"], "w">, HelpText<"Suppress all warnings">;

//===----------------------------------------------------------------------===//
// Dependency Output Options
//===----------------------------------------------------------------------===//

def M_Group : OptionGroup<"M group>">;
let Group = M_Group in {

  def MD : Flag<["-"], "MD">, HelpText<"Emit .d dependency files">;

  def M : Flag<["-"], "M">;
  def emit_dep : Flag<["-"], "emit-dep">, Alias<M>;
}

def output_dep_dir : Separate<["-"], "output-dep-dir">, MetaVarName<"<directory>">,
  HelpText<"Specify output directory for dependencies output">;
def _output_dep_dir : Separate<["-"], "d">, Alias<output_dep_dir>;

def additional_dep_target: Separate<["-"], "additional-dep-target">,
  HelpText<"Additional targets to show up in dependencies output">;
def _additional_dep_target : Separate<["-"], "a">, Alias<additional_dep_target>;

//===----------------------------------------------------------------------===//
// Reflection Options
//===----------------------------------------------------------------------===//

def reflect_cpp : Flag<["-"], "reflect-c++">,
  HelpText<"Reflect C++ classes">;

//===----------------------------------------------------------------------===//
// Misc Options
//===----------------------------------------------------------------------===//

def verbose : Flag<["-"], "v">,
  HelpText<"Display verbose information during the compilation">;
def _verbose : Flag<["-"], "verbose">, Alias<verbose>;
def __verbose : Flag<["--"], "verbose">, Alias<verbose>;

def help : Flag<["-"], "help">,
  HelpText<"Print this help text">;
def _help : Flag<["--"], "help">, Alias<help>;
def __help : Flag<["-"], "h">, Alias<help>;

def version : Flag<["-"], "version">,
  HelpText<"Print the assembler version">;
def _version : Flag<["--"], "version">, Alias<version>;

// Compatible with old slang
def no_link : Flag<["-"], "no-link">;  // currently no effect