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: bool

Only 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: bool

Treat warnings as errors.

§only_create_asm_file: bool

Only run preprocess and compiler steps to produce an assembly file (.s)

§lex: bool

Run the lexer and then stop.

§parse: bool

Run the lexer and parser and then stop.

§validate: bool

Run the lexer, parser and semantic analysis and then stop.

§codegen: bool

Run the lexer, parser, sema, IR translation, and assembly codegen and then stop.

§print_ast: bool

Prints the parsed AST and stops after parsing (before sema).

§print_typechecked_ast: bool

Prints the type-checked AST and stops after sema.

§print_ir: bool

Prints the BlueTac intermediate representation and stops after lowering to IR.

§no_color: bool

By 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

pub fn with_default_warnings() -> Self

Creates the driver options with the default set of enabled warnings.

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

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

Creates the driver options with all warnings disabled.

pub fn is_warning_enabled(&self, kind: WarningKind) -> bool

Is the given warning enabled?

Trait Implementations§

§

impl Debug for DriverOptions

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl Default for DriverOptions

§

fn default() -> DriverOptions

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.