IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: 1.0.0
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

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 = is_defined[StringSpan("__SANITIZE_ADDRESS")]() and (get_defined_int[StringSpan("__SANITIZE_ADDRESS")]() == Int(1))

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.