Struct DriverOptions
pub struct DriverOptions {Show 16 fields
pub preprocessor_defns: Vec<String>,
pub generate_object_file: bool,
pub output_file: Option<String>,
pub link_obj_files: Vec<String>,
pub link_libs: Vec<String>,
pub warnings_as_errors: bool,
pub only_create_asm_file: bool,
pub lex: bool,
pub parse: bool,
pub validate: bool,
pub codegen: bool,
pub print_ast: bool,
pub print_typechecked_ast: bool,
pub print_ir: bool,
pub no_color: bool,
pub flags: HashSet<String>,
/* private fields */
}Expand description
Options that control the Driver compiler driver’s behavior.
Fields§
§preprocessor_defns: Vec<String>Define preprocessor macros.
generate_object_file: boolOnly run preprocess, compiler, and assembler steps to produce an object file (.o)
output_file: Option<String>The file to write the output to, either an object file (.o) or an executable binary file.
link_obj_files: Vec<String>Object files to link with.
link_libs: Vec<String>Libraries to link with.
warnings_as_errors: boolTreat warnings as errors.
only_create_asm_file: boolOnly run preprocess and compiler steps to produce an assembly file (.s)
lex: boolRun the lexer and then stop.
parse: boolRun the lexer and parser and then stop.
validate: boolRun the lexer, parser and semantic analysis and then stop.
codegen: boolRun the lexer, parser, sema, IR translation, and assembly codegen and then stop.
print_ast: boolPrints the parsed AST and stops after parsing (before sema).
print_typechecked_ast: boolPrints the type-checked AST and stops after sema.
print_ir: boolPrints the BlueTac intermediate representation and stops after lowering to IR.
no_color: boolBy default, the BlueC driver prints with ANSI color to stdout or stderr. Set this to true to disable color.
flags: HashSet<String>Flags which were passed on the command-line as ‘-f
Implementations§
§impl DriverOptions
impl DriverOptions
pub fn with_default_warnings() -> Self
pub fn with_default_warnings() -> Self
Creates the driver options with the default set of enabled warnings.
pub fn with_all_warnings() -> Self
pub fn with_all_warnings() -> Self
Creates the driver options with all warnings enabled.
pub fn with_warnings(
enabled: HashSet<WarningKind>,
disabled: HashSet<WarningKind>,
) -> Self
pub fn with_warnings( enabled: HashSet<WarningKind>, disabled: HashSet<WarningKind>, ) -> Self
Creates the driver options with the default set of enabled warnings along with the given set of enabled warnings, but without the given set of disabled warnings.
pub fn without_warnings() -> Self
pub fn without_warnings() -> Self
Creates the driver options with all warnings disabled.
pub fn is_warning_enabled(&self, kind: WarningKind) -> bool
pub fn is_warning_enabled(&self, kind: WarningKind) -> bool
Is the given warning enabled?