These AST node types are fully implemented in code generation:
-
AST_EXPR_LITERAL -
AST_EXPR_IDENTIFIER -
AST_EXPR_BINARY -
AST_EXPR_UNARY -
AST_EXPR_CALL -
AST_EXPR_ASSIGNMENT -
AST_EXPR_GROUPING -
AST_EXPR_CAST -
AST_EXPR_SIZEOF -
AST_EXPR_ALLOC -
AST_EXPR_FREE -
AST_EXPR_DEREF -
AST_EXPR_ADDR -
AST_EXPR_MEMBER -
AST_EXPR_INC -
AST_EXPR_DEC
-
AST_PROGRAM(multi-module support) -
AST_PREPROCESSOR_MODULE -
AST_PREPROCESSOR_USE -
AST_STMT_EXPRESSION -
AST_STMT_VAR_DECL -
AST_STMT_FUNCTION -
AST_STMT_RETURN -
AST_STMT_BLOCK -
AST_STMT_IF -
AST_STMT_PRINT -
AST_STMT_DEFER -
AST_STMT_LOOP(this is for, while, and while-true) -
AST_STMT_IMPL
-
AST_TYPE_BASIC -
AST_TYPE_POINTER -
AST_TYPE_ARRAY -
AST_TYPE_FUNCTION -
AST_TYPE_SET -
AST_TYPE_SOME
- Basic allocation/free tracking by variable name
- Memory leak detection (allocated but never freed)
- Double-free detection with count tracking
- Integration with
deferstatements - Detailed error reporting with source locations
- Anonymous allocation filtering
- Pointer aliasing detection
- Track when
ptr2 = ptr1creates aliases - Warn when analyzer can't track aliased pointers
- Consider ownership transfer semantics
- Allowing structs to point to itself -- name struct {some: *name};
- Conditional path tracking
- Detect leaks in conditional branches (
if/elsewithout free in all paths) - Handle early returns and breaks
- Track memory across loop iterations
- Cross-function tracking
- Track pointers passed to functions as parameters
- Handle functions that free parameters
- Return value allocation tracking
- Support for ownership transfer through function calls
- Complex pointer arithmetic
- Handle
ptr + offsetoperations - Track array element allocations
- Detect out-of-bounds access potential
- Additional memory functions
- Track
realloc()operations - Handle
calloc()andmalloc()variants - Monitor
memcpy()for potential use-after-free
- Struct/array memory management
- Track allocations within struct members
- Handle nested pointer structures
- Monitor array of pointers
- Access after free tracking
- Detect reads/writes to freed pointers
- Track freed pointer usage across scopes
- Integration with dereference operations
- Advanced scope tracking
- Detect pointers escaping local scope
- Handle static/global pointer lifetimes
- Stack vs heap allocation analysis
- Add parsing for templates (
fn[T],struct[T]) - Add parsing for type aliases using
typekeyword - Add parsing for modules and imports refinements
- Design and implement union syntax
- Consider Go/Odin-style loop syntax improvements
- Type inference for generics
- Detect unused imports and symbols
- Implement codegen for
switchormatchconstructs - Support more LLVM optimizations
- Add structs and enums support in codegen
- Add unions support in codegen
- Add in memcpy and streq streq === strcmp
- Add tokens and grammar for unions
- Implement type checking for structs
- Implement type checking for unions
- Investigate pattern matching
- Build minimal standard library
- Consider ownership/borrowing system for advanced memory safety
- Explore compile-time memory layout optimization