docs(llvm/vm): 静的Box(self)規約を明文化 + Bridgeトグル追記; Gate‑C/Core 現状反映; CURRENT_TASK 更新。\n\n- 新規: docs/development/architecture/llvm/static_box_singleton.md\n- 追記: lang/src/vm/README.md に self 先頭規約/互換トグルを明記\n- 追記: CURRENT_TASK に本更新を記録\n- phase-20.33/CHECKLIST にドキュメント完了チェックを追加\n- bak フォルダはリポジトリ直下に存在せず(削除対象なし)\n\n併せて未コミット差分をスナップショット(Rust 層の前作業含む)

This commit is contained in:
nyash-codex
2025-11-01 16:31:48 +09:00
parent b9340a1b19
commit 01b4417c5d
7 changed files with 156 additions and 9 deletions

View File

@ -31,7 +31,14 @@ impl super::MirBuilder {
if let ASTNode::FunctionDeclaration { params, body, .. } = main_method {
// Also materialize a callable function entry "BoxName.main/N" for harness/PyVM
let func_name = format!("{}.{}", box_name, "main");
eprintln!("[DEBUG] build_static_main_box: Before lower_static_method_as_function");
eprintln!("[DEBUG] variable_map = {:?}", self.variable_map);
let _ = self.lower_static_method_as_function(func_name, params.clone(), body.clone());
eprintln!("[DEBUG] build_static_main_box: After lower_static_method_as_function");
eprintln!("[DEBUG] variable_map = {:?}", self.variable_map);
// ✅ PHI UseBeforeDef修正: 関数生成後、変数マップをクリア
// 理由: cf_block()で同じbodyを再処理する際、前の関数の変数PHI ID等が混入するのを防ぐ
self.variable_map.clear();
// Convert the method body to a Program AST node and lower it
let program_ast = ASTNode::Program {
statements: body.clone(),