CC1Options.td revision 7674352cf3e8f699914a2f739f1ae8c8c3480813
1//===--- CC1Options.td - Options for clang -cc1 ---------------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9// 10// This file defines the options accepted by clang -cc1. 11// 12//===----------------------------------------------------------------------===// 13 14// Include the common option parsing interfaces. 15include "OptParser.td" 16 17//===----------------------------------------------------------------------===// 18// Target Options 19//===----------------------------------------------------------------------===// 20 21def target_abi : Separate<"-target-abi">, 22 HelpText<"Target a particular ABI type">; 23def mcpu : Separate<"-mcpu">, 24 HelpText<"Target a specific cpu type ('-mcpu help' for details)">; 25def target_feature : Separate<"-target-feature">, 26 HelpText<"Target specific attributes">; 27def triple : Separate<"-triple">, 28 HelpText<"Specify target triple (e.g. i686-apple-darwin9)">; 29 30//===----------------------------------------------------------------------===// 31// Analyzer Options 32//===----------------------------------------------------------------------===// 33 34def analysis_CFGDump : Flag<"-cfg-dump">, 35 HelpText<"Display Control-Flow Graphs">; 36def analysis_CFGView : Flag<"-cfg-view">, 37 HelpText<"View Control-Flow Graphs using GraphViz">; 38def analysis_DisplayLiveVariables : Flag<"-dump-live-variables">, 39 HelpText<"Print results of live variable analysis">; 40def analysis_SecuritySyntacticChecks : Flag<"-warn-security-syntactic">, 41 HelpText<"Perform quick security checks that require no data flow">; 42def analysis_WarnDeadStores : Flag<"-warn-dead-stores">, 43 HelpText<"Warn about stores to dead variables">; 44def analysis_WarnUninitVals : Flag<"-warn-uninit-values">, 45 HelpText<"Warn about uses of uninitialized variables">; 46def analysis_WarnObjCMethSigs : Flag<"-warn-objc-methodsigs">, 47 HelpText<"Warn about Objective-C method signatures with type incompatibilities">; 48def analysis_WarnObjCDealloc : Flag<"-warn-objc-missing-dealloc">, 49 HelpText<"Warn about Objective-C classes that lack a correct implementation of -dealloc">; 50def analysis_WarnObjCUnusedIvars : Flag<"-warn-objc-unused-ivars">, 51 HelpText<"Warn about private ivars that are never used">; 52def analysis_CheckerCFRef : Flag<"-checker-cfref">, 53 HelpText<"Run the [Core] Foundation reference count checker">; 54def analysis_WarnSizeofPointer : Flag<"-warn-sizeof-pointer">, 55 HelpText<"Warn about unintended use of sizeof() on pointer expressions">; 56def analysis_InlineCall : Flag<"-inline-call">, 57 HelpText<"Experimental transfer function inling callees when its definition is available.">; 58 59def analyzer_store : Separate<"-analyzer-store">, 60 HelpText<"Source Code Analysis - Abstract Memory Store Models">; 61def analyzer_store_EQ : Joined<"-analyzer-store=">, Alias<analyzer_store>; 62 63def analyzer_constraints : Separate<"-analyzer-constraints">, 64 HelpText<"Source Code Analysis - Symbolic Constraint Engines">; 65def analyzer_constraints_EQ : Joined<"-analyzer-constraints=">, 66 Alias<analyzer_constraints>; 67 68def analyzer_output : Separate<"-analyzer-output">, 69 HelpText<"Source Code Analysis - Output Options">; 70def analyzer_output_EQ : Joined<"-analyzer-output=">, 71 Alias<analyzer_output>; 72 73def analyzer_opt_analyze_headers : Flag<"-analyzer-opt-analyze-headers">, 74 HelpText<"Force the static analyzer to analyze functions defined in header files">; 75def analyzer_display_progress : Flag<"-analyzer-display-progress">, 76 HelpText<"Emit verbose output about the analyzer's progress">; 77def analyzer_experimental_checks : Flag<"-analyzer-experimental-checks">, 78 HelpText<"Use experimental path-sensitive checks">; 79def analyzer_experimental_internal_checks : 80 Flag<"-analyzer-experimental-internal-checks">, 81 HelpText<"Use new default path-sensitive checks currently in testing">; 82def analyze_function : Separate<"-analyze-function">, 83 HelpText<"Run analysis on specific function">; 84def analyze_function_EQ : Joined<"-analyze-function=">, Alias<analyze_function>; 85def analyzer_eagerly_assume : Flag<"-analyzer-eagerly-assume">, 86 HelpText<"Eagerly assume the truth/falseness of some symbolic constraints">; 87def analyzer_no_purge_dead : Flag<"-analyzer-no-purge-dead">, 88 HelpText<"Don't remove dead symbols, bindings, and constraints before processing a statement">; 89def trim_egraph : Flag<"-trim-egraph">, 90 HelpText<"Only show error-related paths in the analysis graph">; 91def analyzer_viz_egraph_graphviz : Flag<"-analyzer-viz-egraph-graphviz">, 92 HelpText<"Display exploded graph using GraphViz">; 93def analyzer_viz_egraph_ubigraph : Flag<"-analyzer-viz-egraph-ubigraph">, 94 HelpText<"Display exploded graph using Ubigraph">; 95 96//===----------------------------------------------------------------------===// 97// CodeGen Options 98//===----------------------------------------------------------------------===// 99 100def disable_llvm_optzns : Flag<"-disable-llvm-optzns">, 101 HelpText<"Don't run LLVM optimization passes">; 102def disable_red_zone : Flag<"-disable-red-zone">, 103 HelpText<"Do not emit code that uses the red zone.">; 104def g : Flag<"-g">, HelpText<"Generate source level debug information">; 105def fno_common : Flag<"-fno-common">, 106 HelpText<"Compile common globals like normal definitions">; 107def no_implicit_float : Flag<"-no-implicit-float">, 108 HelpText<"Don't generate implicit floating point instructions (x86-only)">; 109def fno_merge_all_constants : Flag<"-fno-merge-all-constants">, 110 HelpText<"Disallow merging of constants.">; 111def O : Joined<"-O">, HelpText<"Optimization level">; 112def Os : Flag<"-Os">, HelpText<"Optimize for size">; 113 114//===----------------------------------------------------------------------===// 115// Dependency Output Options 116//===----------------------------------------------------------------------===// 117 118def dependency_file : Separate<"-dependency-file">, 119 HelpText<"Filename (or -) to write dependency output to">; 120def sys_header_deps : Flag<"-sys-header-deps">, 121 HelpText<"Include system headers in dependency output">; 122def MT : Separate<"-MT">, HelpText<"Specify target for dependency">; 123def MP : Flag<"-MP">, 124 HelpText<"Create phony target for each dependency (other than main file)">; 125 126//===----------------------------------------------------------------------===// 127// Diagnostic Options 128//===----------------------------------------------------------------------===// 129 130def dump_build_information : Separate<"-dump-build-information">, 131 MetaVarName<"filename">, 132 HelpText<"output a dump of some build information to a file">; 133def fno_show_column : Flag<"-fno-show-column">, 134 HelpText<"Do not include column number on diagnostics">; 135def fno_show_source_location : Flag<"-fno-show-source-location">, 136 HelpText<"Do not include source location information with diagnostics">; 137def fno_caret_diagnostics : Flag<"-fno-caret-diagnostics">, 138 HelpText<"Do not include source line and caret with diagnostics">; 139def fno_diagnostics_fixit_info : Flag<"-fno-diagnostics-fixit-info">, 140 HelpText<"Do not include fixit information in diagnostics">; 141def w : Flag<"-w">, HelpText<"Suppress all warnings">; 142def pedantic : Flag<"-pedantic">; 143def pedantic_errors : Flag<"-pedantic-errors">; 144 145// This gets all -W options, including -Werror, -W[no-]system-headers, etc. The 146// driver has stripped off -Wa,foo etc. The driver has also translated -W to 147// -Wextra, so we don't need to worry about it. 148def W : Joined<"-W">; 149 150def fdiagnostics_print_source_range_info : Flag<"-fdiagnostics-print-source-range-info">, 151 HelpText<"Print source range spans in numeric form">; 152def fdiagnostics_show_option : Flag<"-fdiagnostics-show-option">, 153 HelpText<"Print diagnostic name with mappable diagnostics">; 154def fmessage_length : Separate<"-fmessage-length">, MetaVarName<"N">, 155 HelpText<"Format message diagnostics so that they fit within N columns or fewer, when possible.">; 156def fcolor_diagnostics : Flag<"-fcolor-diagnostics">, 157 HelpText<"Use colors in diagnostics">; 158def Wno_rewrite_macros : Flag<"-Wno-rewrite-macros">, 159 HelpText<"Silence ObjC rewriting warnings">; 160def verify : Flag<"-verify">, 161 HelpText<"Verify emitted diagnostics and warnings">; 162 163//===----------------------------------------------------------------------===// 164// Frontend Options 165//===----------------------------------------------------------------------===// 166 167def code_completion_at : Separate<"-code-completion-at">, 168 MetaVarName<"file:line:column">, 169 HelpText<"Dump code-completion information at a location">; 170def no_code_completion_debug_printer : Flag<"-no-code-completion-debug-printer">, 171 HelpText<"Don't the \"debug\" code-completion print">; 172def code_completion_macros : Flag<"-code-completion-macros">, 173 HelpText<"Include macros in code-completion results">; 174def disable_free : Flag<"-disable-free">, 175 HelpText<"Disable freeing of memory on exit">; 176def empty_input_only : Flag<"-empty-input-only">, 177 HelpText<"Force running on an empty input file">; 178def x : Separate<"-x">, HelpText<"Input language type">; 179def cxx_inheritance_view : Separate<"-cxx-inheritance-view">, 180 MetaVarName<"class name">, 181 HelpText<"View C++ inheritance for a specified class">; 182def fixit_at : Separate<"-fixit-at">, MetaVarName<"source-location">, 183 HelpText<"Perform Fix-It modifications at the given source location">; 184def o : Separate<"-o">, MetaVarName<"path">, HelpText<"Specify output file">; 185def plugin : Separate<"-plugin">, 186 HelpText<"Use the named plugin action (use \"help\" to list available options)">; 187 188def Action_Group : OptionGroup<"<action group>">; 189let Group = Action_Group in { 190 191def Eonly : Flag<"-Eonly">, 192 HelpText<"Just run preprocessor, no output (for timings)">; 193def E : Flag<"-E">, 194 HelpText<"Run preprocessor, emit preprocessed file">; 195def dump_raw_tokens : Flag<"-dump-raw-tokens">, 196 HelpText<"Lex file in raw mode and dump raw tokens">; 197def analyze : Flag<"-analyze">, 198 HelpText<"Run static analysis engine">; 199def dump_tokens : Flag<"-dump-tokens">, 200 HelpText<"Run preprocessor, dump internal rep of tokens">; 201def parse_noop : Flag<"-parse-noop">, 202 HelpText<"Run parser with noop callbacks (for timings)">; 203def fsyntax_only : Flag<"-fsyntax-only">, 204 HelpText<"Run parser and perform semantic analysis">; 205def fixit : Flag<"-fixit">, 206 HelpText<"Apply fix-it advice to the input source">; 207def parse_print_callbacks : Flag<"-parse-print-callbacks">, 208 HelpText<"Run parser and print each callback invoked">; 209def emit_html : Flag<"-emit-html">, 210 HelpText<"Output input source as HTML">; 211def ast_print : Flag<"-ast-print">, 212 HelpText<"Build ASTs and then pretty-print them">; 213def ast_print_xml : Flag<"-ast-print-xml">, 214 HelpText<"Build ASTs and then print them in XML format">; 215def ast_dump : Flag<"-ast-dump">, 216 HelpText<"Build ASTs and then debug dump them">; 217def ast_view : Flag<"-ast-view">, 218 HelpText<"Build ASTs and view them with GraphViz">; 219def print_decl_contexts : Flag<"-print-decl-contexts">, 220 HelpText<"Print DeclContexts and their Decls">; 221def dump_record_layouts : Flag<"-dump-record-layouts">, 222 HelpText<"Dump record layout information">; 223def emit_pth : Flag<"-emit-pth">, 224 HelpText<"Generate pre-tokenized header file">; 225def emit_pch : Flag<"-emit-pch">, 226 HelpText<"Generate pre-compiled header file">; 227def S : Flag<"-S">, 228 HelpText<"Emit native assembly code">; 229def emit_llvm : Flag<"-emit-llvm">, 230 HelpText<"Build ASTs then convert to LLVM, emit .ll file">; 231def emit_llvm_bc : Flag<"-emit-llvm-bc">, 232 HelpText<"Build ASTs then convert to LLVM, emit .bc file">; 233def emit_llvm_only : Flag<"-emit-llvm-only">, 234 HelpText<"Build ASTs and convert to LLVM, discarding output">; 235def rewrite_test : Flag<"-rewrite-test">, 236 HelpText<"Rewriter playground">; 237def rewrite_objc : Flag<"-rewrite-objc">, 238 HelpText<"Rewrite ObjC into C (code rewriter example)">; 239def rewrite_macros : Flag<"-rewrite-macros">, 240 HelpText<"Expand macros without full preprocessing">; 241def rewrite_blocks : Flag<"-rewrite-blocks">, 242 HelpText<"Rewrite Blocks to C">; 243 244} 245 246def relocatable_pch : Flag<"-relocatable-pch">, 247 HelpText<"Whether to build a relocatable precompiled header">; 248def print_stats : Flag<"-print-stats">, 249 HelpText<"Print performance metrics and statistics">; 250def ftime_report : Flag<"-ftime-report">, 251 HelpText<"Print the amount of time each phase of compilation takes">; 252 253//===----------------------------------------------------------------------===// 254// Language Options 255//===----------------------------------------------------------------------===// 256 257def fno_builtin : Flag<"-fno-builtin">, 258 HelpText<"Disable implicit builtin knowledge of functions">; 259def faltivec : Flag<"-faltivec">, 260 HelpText<"Enable AltiVec vector initializer syntax">; 261def faccess_control : Flag<"-faccess-control">, 262 HelpText<"Enable C++ access control">; 263def fdollars_in_identifiers : Flag<"-fdollars-in-identifiers">, 264 HelpText<"Allow '$' in identifiers">; 265def femit_all_decls : Flag<"-femit-all-decls">, 266 HelpText<"Emit all declarations, even if unused">; 267def fblocks : Flag<"-fblocks">, 268 HelpText<"enable the 'blocks' language feature">; 269def fheinous_gnu_extensions : Flag<"-fheinous-gnu-extensions">; 270def fexceptions : Flag<"-fexceptions">, 271 HelpText<"Enable support for exception handling">; 272def ffreestanding : Flag<"-ffreestanding">, 273 HelpText<"Assert that the compilation takes place in a freestanding environment">; 274def fgnu_runtime : Flag<"-fgnu-runtime">, 275 HelpText<"Generate output compatible with the standard GNU Objective-C runtime">; 276def std_EQ : Joined<"-std">, 277 HelpText<"Language standard to compile for">; 278def fms_extensions : Flag<"-fms-extensions">, 279 HelpText<"Accept some non-standard constructs used in Microsoft header files ">; 280def main_file_name : Separate<"-main-file-name">, 281 HelpText<"Main file name to use for debug info">; 282def fno_elide_constructors : Flag<"-fno-elide-constructors">, 283 HelpText<"Disable C++ copy constructor elision">; 284def fno_lax_vector_conversions : Flag<"-fno-lax-vector-conversions">, 285 HelpText<"Disallow implicit conversions between vectors with a different number of elements or different element types">; 286def fno_math_errno : Flag<"-fno-math-errno">, 287 HelpText<"Don't require math functions to respect errno">; 288def fno_signed_char : Flag<"-fno-signed-char">, 289 HelpText<"Char is unsigned">; 290def fno_operator_names : Flag<"-fno-operator-names">, 291 HelpText<"Do not treat C++ operator name keywords as synonyms for operators">; 292def fconstant_string_class : Separate<"-fconstant-string-class">, 293 MetaVarName<"class name">, 294 HelpText<"Specify the class to use for constant Objective-C string objects.">; 295def fobjc_gc : Flag<"-fobjc-gc">, 296 HelpText<"Enable Objective-C garbage collection">; 297def fobjc_gc_only : Flag<"-fobjc-gc-only">, 298 HelpText<"Use GC exclusively for Objective-C related memory management">; 299def print_ivar_layout : Flag<"-print-ivar-layout">, 300 HelpText<"Enable Objective-C Ivar layout bitmap print trace">; 301def fobjc_nonfragile_abi : Flag<"-fobjc-nonfragile-abi">, 302 HelpText<"enable objective-c's nonfragile abi">; 303def ftrapv : Flag<"-ftrapv">, 304 HelpText<"Trap on integer overflow">; 305def pic_level : Separate<"-pic-level">, 306 HelpText<"-Value for __PIC__">; 307def pthread : Flag<"-pthread">, 308 HelpText<"Support POSIX threads in generated code">; 309def fpascal_strings : Flag<"-fpascal-strings">, 310 HelpText<"Recognize and construct Pascal-style string literals">; 311def fno_rtti : Flag<"-fno-rtti">, 312 HelpText<"Disable generation of rtti information">; 313def fshort_wchar : Flag<"-fshort-wchar">, 314 HelpText<"Force wchar_t to be a short unsigned int">; 315def static_define : Flag<"-static-define">, 316 HelpText<"Should __STATIC__ be defined">; 317def stack_protector : Separate<"-stack-protector">, 318 HelpText<"Enable stack protectors">; 319def fvisibility : Separate<"-fvisibility">, 320 HelpText<"Default symbol visibility">; 321def ftemplate_depth : Separate<"-ftemplate-depth">, 322 HelpText<"Maximum depth of recursive template instantiation">; 323def trigraphs : Flag<"-trigraphs">, 324 HelpText<"Process trigraph sequences">; 325def fwritable_strings : Flag<"-fwritable-strings">, 326 HelpText<"Store string literals as writable data">; 327 328//===----------------------------------------------------------------------===// 329// Header Search Options 330//===----------------------------------------------------------------------===// 331 332def nostdinc : Flag<"-nostdinc">, 333 HelpText<"Disable standard #include directories">; 334def nobuiltininc : Flag<"-nobuiltininc">, 335 HelpText<"Disable builtin #include directories">; 336def F : JoinedOrSeparate<"-F">, MetaVarName<"directory">, 337 HelpText<"Add directory to framework include search path">; 338def I : JoinedOrSeparate<"-I">, MetaVarName<"directory">, 339 HelpText<"Add directory to include search path">; 340def idirafter : Separate<"-idirafter">, MetaVarName<"directory">, 341 HelpText<"Add directory to AFTER include search path">; 342def iquote : Separate<"-iquote">, MetaVarName<"directory">, 343 HelpText<"Add directory to QUOTE include search path">; 344def isystem : Separate<"-isystem">, MetaVarName<"directory">, 345 HelpText<"Add directory to SYSTEM include search path">; 346def iprefix : Separate<"-iprefix">, MetaVarName<"prefix">, 347 HelpText<"Set the -iwithprefix/-iwithprefixbefore prefix">; 348def iwithprefix : Separate<"-iwithprefix">, MetaVarName<"dir">, 349 HelpText<"Set directory to SYSTEM include search path with prefix">; 350def iwithprefixbefore : Separate<"-iwithprefixbefore">, MetaVarName<"dir">, 351 HelpText<"Set directory to include search path with prefix">; 352def isysroot : Separate<"-isysroot">, MetaVarName<"dir">, 353 HelpText<"Set the system root directory (usually /)">; 354def v : Flag<"-v">, HelpText<"Enable verbose output">; 355 356//===----------------------------------------------------------------------===// 357// Preprocessor Options 358//===----------------------------------------------------------------------===// 359 360def D : JoinedOrSeparate<"-D">, MetaVarName<"macro">, 361 HelpText<"Predefine the specified macro">; 362def include_ : Separate<"-include">, MetaVarName<"file">, EnumName<"include">, 363 HelpText<"Include file before parsing">; 364def imacros : Separate<"-imacros">, MetaVarName<"file">, 365 HelpText<"Include macros from file before parsing">; 366def include_pch : Separate<"-include-pch">, MetaVarName<"file">, 367 HelpText<"Include precompiled header file">; 368def include_pth : Separate<"-include-pth">, MetaVarName<"file">, 369 HelpText<"Include file before parsing">; 370def token_cache : Separate<"-token-cache">, MetaVarName<"path">, 371 HelpText<"Use specified token cache file">; 372def U : JoinedOrSeparate<"-U">, MetaVarName<"macro">, 373 HelpText<"Undefine the specified macro">; 374def undef : Flag<"-undef">, MetaVarName<"macro">, 375 HelpText<"undef all system defines">; 376 377//===----------------------------------------------------------------------===// 378// Preprocessed Output Options 379//===----------------------------------------------------------------------===// 380 381def P : Flag<"-P">, 382 HelpText<"Disable linemarker output in -E mode">; 383def C : Flag<"-C">, 384 HelpText<"Enable comment output in -E mode">; 385def CC : Flag<"-CC">, 386 HelpText<"Enable comment output in -E mode, even from macro expansions">; 387def dM : Flag<"-dM">, 388 HelpText<"Print macro definitions in -E mode instead of normal output">; 389def dD : Flag<"-dD">, 390 HelpText<"Print macro definitions in -E mode in addition to normal output">; 391