Skip to main content

Mojo module

compile

Implements functions that return compile-time information.

comptime values

DebugLevel

comptime DebugLevel = _DebugLevel()

Represents the debug level used during compilation.

OptimizationLevel

comptime OptimizationLevel = _OptimizationLevel()

Represents the optimization level used during compilation.

SanitizeAddress

comptime SanitizeAddress = (env_get_int["__SANITIZE_ADDRESS"]() == 1) if is_defined["__SANITIZE_ADDRESS"]() else is_defined["__SANITIZE_ADDRESS"]()

True if address sanitizer is enabled at compile-time.

Functions

  • codegen_unreachable: Compilation fails if cond is True and the caller of the function is being generated as runtime code.
  • is_compile_time: Returns true if the current code is executed at compile time, false otherwise.

Was this page helpful?