Skip to content

LLVM: Add if/ifelse, extract IRCoercion, flatten irVariableTableType - #1415

Open
LadyCailin wants to merge 1 commit into
masterfrom
llvm-next
Open

LLVM: Add if/ifelse, extract IRCoercion, flatten irVariableTableType#1415
LadyCailin wants to merge 1 commit into
masterfrom
llvm-next

Conversation

@LadyCailin

Copy link
Copy Markdown
Member
  • Implement if/ifelse control flow for the LLVM backend. ifelse handles the general [cond, code]... pattern; _if delegates to it. Branch bodies push/pop variable scopes matching the intended strict-mode semantics.

  • Extract coercion helpers (coerceToBoolean, coerceToDouble, emitCoerceToBoolRuntime, emitCoerceToDoubleRuntime) from BasicLogic into a new shared IRCoercion class. Add unified toBool() that handles both compile-time known types and runtime ms_value dispatch.

  • Flatten irVariableTableType from Stack<Map<Integer, IRType>> to a plain Map, since SSA numbers are function-global and must remain visible after scope pops. MS-level variable scoping stacks are unchanged.

  • Add IRBuilder.appendLabel() for type-safe label emission, replacing manual string concatenation with ":".

 - Implement if/ifelse control flow for the LLVM backend. ifelse handles
   the general [cond, code]... pattern; _if delegates to it. Branch bodies
   push/pop variable scopes matching the intended strict-mode semantics.

 - Extract coercion helpers (coerceToBoolean, coerceToDouble,
   emitCoerceToBoolRuntime, emitCoerceToDoubleRuntime) from BasicLogic
   into a new shared IRCoercion class. Add unified toBool() that handles
   both compile-time known types and runtime ms_value dispatch.

 - Flatten irVariableTableType from Stack<Map<Integer, IRType>> to a
   plain Map, since SSA numbers are function-global and must remain
   visible after scope pops. MS-level variable scoping stacks are
   unchanged.

 - Add IRBuilder.appendLabel() for type-safe label emission, replacing
   manual string concatenation with ":".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant