refactor(mir): Remove ScopeContext legacy fields (Phase 2-4/7)

完全移行→削除の安全順序(Option C)に従い、ScopeContextの
deprecated フィールドと sync helpers を完全削除。

## Changes
- Migrated all access sites to scope_ctx.*
- Removed 7 deprecated fields:
  - current_function
  - lexical_scope_stack
  - function_param_names
  - loop_header_stack
  - loop_exit_stack
  - if_merge_stack
  - debug_scope_stack
- Removed 2 sync helpers (sync_scope_ctx_to_legacy, sync_legacy_to_scope_ctx)
- Updated 20+ files with direct field access

## Tests
- cargo build --release: PASS 
- Deprecation warnings: 255 → 166 (-89, -35%)

Phase 2 Progress: 4/7 contexts complete (57%)
This commit is contained in:
nyash-codex
2025-12-15 23:41:30 +09:00
parent b92f85f993
commit 7235fe62e9
21 changed files with 78 additions and 158 deletions

View File

@ -733,7 +733,7 @@ pub(in crate::mir::builder) fn merge_joinir_mir_blocks(
#[cfg(debug_assertions)]
{
if let Some(boundary) = boundary {
if let Some(ref func) = builder.current_function {
if let Some(ref func) = builder.scope_ctx.current_function {
verify_joinir_contracts(
func,
entry_block,