Skip to main content

Module rust_codegen

Module rust_codegen 

Source
Expand description

Rust コード生成モジュール

型推論結果から Rust コードを生成する。

Structs§

BindingsInfo
bindings.rs から抽出した codegen 用情報
CodegenConfig
コード生成の設定
CodegenDriver
コード生成全体を管理する構造体
CodegenStats
コード生成統計
GeneratedCode
一つの関数の生成結果
KnownSymbols
コード生成時に解決可能なシンボルの集合
RustCodegen
単一関数を生成するためのコード生成器(使い捨て)

Enums§

GenerateStatus
生成ステータス

Functions§

collect_must_mut_from_expr
collect_must_mut_from_stmt
collect_must_mut_pointer_params
マクロ本体を走査し、&mut param や代入先として使用されるパラメータを検出する ポインタパラメータが *mut である必要があるかを判定する。 callee_const_params: 呼び出し先マクロで *const に確定したパラメータ情報 key = マクロ名(InternedStr), value = const パラメータの引数位置集合
is_boolean_expr
式が bool として扱える形式かどうかを判定
is_boolean_expr_with_context
コンテキスト付き bool 式判定: 呼び出し先マクロ/外部関数の戻り値型も考慮
mark_lvalue_mut
代入先の式に含まれるパラメータを must-mut としてマークする
pointer_const_differs
両方ポインタで、inner は compatible だが const/mut が違う場合に true。
pointer_inner_compatible
2 つのポインタ型の inner が Rust として「同じ型」か判定する (const/mut は無視)。