Skip to content

IR generator does not handle identifiers in expressions #4

Description

@SAMBA8695

Bug Report: IR Generation Does Not Handle Variable References

Description

The parser correctly builds AST nodes for identifiers (AST_VAR), but the IR generation phase does not handle them at all.

As a result, any expression that references a variable is parsed successfully but fails to generate correct IR and LLVM output.

Example Input

let x = 1;
let y = x + 2;

Current Behavior

  • AST_VAR nodes are created by the parser
  • generate_ir_from_ast() ignores AST_VAR
  • IR generation produces incomplete or incorrect LLVM IR
  • No error is reported

Expected Behavior

  • Identifiers should be translated into IR by loading their values
  • Variable declarations should store computed values
  • Using an undefined variable should produce an error

Location

  • File: irgen.c
  • Function: generate_ir_from_ast()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions