Files
swift-mirror/include/swift/Driver/FrontendOptions.td
Connor Wakamo 9747d87ff6 [frontend] Added a handful of options to force the frontend to assert or crash.
Added -debug-assert-immediately and -debug-crash-immediately, which cause an
llvm_unreachable or LLVM_BUILTIN_TRAP to execute during argument parsing.

Added -debug-assert-after-parse and -debug-crash-after-parse, which cause an
llvm_unreachable or LLVM_BUILTIN_TRAP to execute after calling
CompilerInstance::performParse().

This fixes <rdar://problem/16013025>.

Swift SVN r13653
2014-02-07 22:03:32 +00:00

117 lines
4.6 KiB
TableGen

//===--- FrontendOptions.td - Options for swift -frontend -----------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// This file defines the options accepted by swift -frontend.
//
//===----------------------------------------------------------------------===//
let Flags = [FrontendOption, NoDriverOption] in {
def triple : Separate<["-"], "triple">, Alias<target>;
def delayed_function_body_parsing :
Flag<["-"], "delayed-function-body-parsing">,
HelpText<"Delay function body parsing until the end of all files">;
def primary_file : Separate<["-"], "primary-file">,
HelpText<"Produce output for this file, not the whole module">;
def primary_file_EQ : Joined<["-"], "primary-file=">, Alias<primary_file>;
def serialize_diagnostics_path
: Separate<["-"], "serialize-diagnostics-path">, MetaVarName<"<path>">,
HelpText<"Output serialized diagnostics to <path>">;
def serialize_diagnostics_path_EQ
: Joined<["-"], "serialize-diagnostics-path=">,
Alias<serialize_diagnostics_path>;
def verify : Flag<["-"], "verify">,
HelpText<"Verify diagnostics against expected-{error|warning|note} "
"annotations">;
} // end let Flags = [FrontendOption, NoDriverOption]
def debug_crash_Group : OptionGroup<"<automatic crashing options>">;
class DebugCrashOpt : Group<debug_crash_Group>;
let Flags = [FrontendOption, NoDriverOption, HelpHidden] in {
def debug_constraints : Flag<["-"], "debug-constraints">,
HelpText<"Debug the constraint-based type checker">;
def debug_constraints_attempt : Separate<["-"], "debug-constraints-attempt">,
HelpText<"Debug the constraint solver at a given attempt">;
def debug_constraints_attempt_EQ : Joined<["-"], "debug-constraints-attempt=">,
Alias<debug_constraints_attempt>;
def debug_assert_immediately : Flag<["-"], "debug-assert-immediately">,
DebugCrashOpt, HelpText<"Force an assertion failure immediately">;
def debug_assert_after_parse : Flag<["-"], "debug-assert-after-parse">,
DebugCrashOpt, HelpText<"Force an assertion failure after parsing">;
def debug_crash_immediately : Flag<["-"], "debug-crash-immediately">,
DebugCrashOpt, HelpText<"Force a crash immediately">;
def debug_crash_after_parse : Flag<["-"], "debug-crash-after-parse">,
DebugCrashOpt, HelpText<"Force a crash after parsing">;
def disable_arc_opts : Flag<["-"], "disable-arc-opts">,
HelpText<"Don't run SIL ARC optimization passes.">;
def disable_all_runtime_checks : Flag<["-"], "disable-all-runtime-checks">,
HelpText<"Disable all intrinsic runtime safety checks">;
def disable_diagnostic_passes : Flag<["-"], "disable-diagnostic-passes">,
HelpText<"Don't run diagnostic passes">;
def disable_llvm_optzns : Flag<["-"], "disable-llvm-optzns">,
HelpText<"Don't run LLVM optimization passes">;
def disable_llvm_arc_opts : Flag<["-"], "disable-llvm-arc-opts">,
HelpText<"Don't run LLVM ARC optimization passes.">;
def disable_sil_linking : Flag<["-"], "disable-sil-linking">,
HelpText<"Don't link SIL functions">;
def emit_verbose_sil : Flag<["-"], "emit-verbose-sil">,
HelpText<"Emit locations during SIL emission">;
def enable_dynamic_value_type_layout :
Flag<["-"], "enable-dynamic-value-type-layout">,
HelpText<"Enable experimental dynamic generic struct/enum type layout">;
def enable_experimental_patterns : Flag<["-"], "enable-experimental-patterns">,
HelpText<"Enable experimental 'switch' pattern matching features">;
def enable_source_import : Flag<["-"], "enable-source-import">,
HelpText<"Enable importing of Swift source files">;
def print_stats : Flag<["-"], "print-stats">,
HelpText<"Print various statistics">;
def sil_inline_threshold : Separate<["-"], "sil-inline-threshold">,
MetaVarName<"<50>">,
HelpText<"Controls the aggressiveness of performance inlining">;
def sil_devirt_threshold : Separate<["-"], "sil-devirt-threshold">,
MetaVarName<"<0>">,
HelpText<"Controls the aggressiveness of devirtualization">;
def sil_link_all : Flag<["-"], "sil-link-all">,
HelpText<"Link all SIL functions">;
def sil_serialize_all : Flag<["-"], "sil-serialize-all">,
HelpText<"Serialize all generated SIL">;
def use_malloc : Flag<["-"], "use-malloc">,
HelpText<"Allocate internal data structures using malloc "
"(for memory debugging)">;
} // end let Flags = [FrontendOption, NoDriverOption, HelpHidden]