Reduce build warnings

This commit is contained in:
2025-12-28 01:34:46 +09:00
parent b104d6af5f
commit 0269fc2ed4
41 changed files with 77 additions and 26 deletions

View File

@ -43,6 +43,7 @@ use crate::mir::control_form::LoopId;
/// - `header`: ループヘッダーContinue の配線先)
/// - `after`: ループ後のブロックBreak の配線先)
/// - `body`: ループ本体の断片
#[allow(dead_code)]
pub(crate) fn loop_(
loop_id: LoopId,
header: BasicBlockId,

View File

@ -37,6 +37,7 @@ use crate::mir::builder::control_flow::edgecfg::api::frag::Frag;
/// # 引数
/// - `a`: 前段の断片
/// - `b`: 後段の断片
#[allow(dead_code)]
pub(crate) fn seq(a: Frag, b: Frag) -> Frag {
let mut exits = BTreeMap::new();
let mut wires = Vec::new();

View File

@ -64,6 +64,7 @@ impl EdgeStub {
}
/// 既に配線先が確定している EdgeStub を生成(テスト/配線済み用途)
#[allow(dead_code)]
pub fn with_target(
from: BasicBlockId,
kind: ExitKind,

View File

@ -30,9 +30,11 @@ pub enum ExitKind {
Break(LoopId),
/// 指定ループの次回イテレーション
#[allow(dead_code)]
Continue(LoopId),
/// 例外のunwindInvoke.err → catch
#[allow(dead_code)]
Unwind,
/// 非同期タスクのキャンセル(予約:将来の async/drop 用)
@ -42,11 +44,13 @@ pub enum ExitKind {
impl ExitKind {
/// ループ関連の脱出か判定
#[allow(dead_code)]
pub fn is_loop_exit(&self) -> bool {
matches!(self, ExitKind::Break(_) | ExitKind::Continue(_))
}
/// 関数全体からの脱出か判定
#[allow(dead_code)]
pub fn is_function_exit(&self) -> bool {
matches!(self, ExitKind::Return | ExitKind::Unwind)
}

View File

@ -83,16 +83,19 @@ impl Frag {
}
/// 特定 ExitKind の未配線 edge を追加
#[allow(dead_code)]
pub fn add_exit(&mut self, stub: EdgeStub) {
self.exits.entry(stub.kind).or_insert_with(Vec::new).push(stub);
}
/// 特定 ExitKind の未配線 edge を取得
#[allow(dead_code)]
pub fn get_exits(&self, kind: &ExitKind) -> Option<&Vec<EdgeStub>> {
self.exits.get(kind)
}
/// すべての ExitKind を列挙
#[allow(dead_code)]
pub fn exit_kinds(&self) -> impl Iterator<Item = &ExitKind> {
self.exits.keys()
}

View File

@ -21,6 +21,7 @@ use super::frag::Frag;
/// # Phase 265 P2
/// - wires/exits 分離契約の「置き場所」確保
/// - 警告出力のみ、Err 化は Phase 266 で実施
#[allow(dead_code)]
pub fn verify_frag_invariants(frag: &Frag) -> Result<(), String> {
// Phase 265 P2: exits と wires の両方が空の場合は警告
if frag.exits.is_empty() && frag.wires.is_empty() {

View File

@ -23,6 +23,7 @@ use crate::mir::loop_pattern_detection::{LoopFeatures, LoopPatternKind};
/// 1. Create with `new()` - AST + Router info only
/// 2. Call `set_canonicalizer_result()` - Add Canonicalizer output
/// 3. Call `verify_parity()` - Check consistency (dev-only)
#[allow(dead_code)]
#[derive(Debug)]
pub struct LoopProcessingContext<'a> {
// ========================================================================
@ -56,6 +57,7 @@ pub struct LoopProcessingContext<'a> {
pub features: LoopFeatures,
}
#[allow(dead_code)]
impl<'a> LoopProcessingContext<'a> {
/// Create new context (canonicalizer not run yet)
///

View File

@ -9,8 +9,10 @@ pub struct MergeConfig {
/// Enable strict contract verification (fail-fast on violations)
pub strict_mode: bool,
/// Exit reconnection mode (Phi or DirectValue)
#[allow(dead_code)]
pub exit_reconnect_mode: Option<crate::mir::join_ir::lowering::carrier_info::ExitReconnectMode>,
/// Allow missing exit block in contract checks (typically exit_block_id before insertion)
#[allow(dead_code)]
pub allow_missing_exit_block: bool,
}
@ -26,6 +28,7 @@ impl MergeConfig {
}
/// Strict configuration for development/debugging (all checks enabled)
#[allow(dead_code)]
pub fn strict() -> Self {
Self {
dev_log: true,

View File

@ -37,6 +37,7 @@ use std::collections::BTreeMap;
#[derive(Debug, Clone)]
pub struct ExitArgsCollectionResult {
/// The source block for these values
#[allow(dead_code)]
pub block_id: BasicBlockId,
/// The expression result value (jump_args[0], optional)
pub expr_result_value: Option<ValueId>,
@ -232,6 +233,7 @@ impl ExitArgsCollectorBox {
/// Convenience method: Convert collected carrier values to BTreeMap
///
/// This matches the format expected by instruction_rewriter.rs's carrier_inputs.
#[allow(dead_code)]
pub fn to_carrier_map(
carrier_values: Vec<(String, (BasicBlockId, ValueId))>,
) -> BTreeMap<String, Vec<(BasicBlockId, ValueId)>> {

View File

@ -24,6 +24,8 @@
//! - `is_skippable_continuation`: Structural check for skippable continuation functions
//! - `merge_and_rewrite`: Main orchestrator for JoinIR→MIR merge
#![allow(dead_code)]
// Phase 260 P0.1 Step 1: Forward all declarations to parent instruction_rewriter.rs
// This allows gradual migration without breaking existing code.
//

View File

@ -18,6 +18,8 @@
//! - Remapping of ValueIds (handled by JoinIrIdRemapper)
//! - Instruction rewriting of non-k_exit instructions (handled by instruction_rewriter)
#![allow(dead_code)]
use crate::mir::{BasicBlockId, MirInstruction, ValueId};
use std::collections::BTreeSet;

View File

@ -52,6 +52,8 @@
//! Phase 255 P2: Common Utilities
//! - common/: Shared helper functions (var() etc.) to eliminate code duplication
#![allow(dead_code)]
pub(in crate::mir::builder) mod common; // Phase 255 P2: Common AST helpers
pub(in crate::mir::builder) mod extractors; // Phase 282 P3: Common extraction interfaces
pub(in crate::mir::builder) mod pattern_recognizers; // Phase 287 P1: Modularized pattern recognizers

View File

@ -162,6 +162,7 @@ impl NormalizationExecuteBox {
/// Execute Phase 132-133: Loop + post assignments + return
///
/// ## Phase 141 P1.5: Added prefix_variables parameter
#[allow(dead_code)]
fn execute_loop_with_post(
builder: &mut MirBuilder,
plan: &NormalizationPlan,

View File

@ -17,6 +17,7 @@ pub struct NormalizationPlan {
/// Kind of normalization pattern detected
#[derive(Debug, Clone, PartialEq, Eq)]
#[allow(dead_code)]
pub enum PlanKind {
/// Phase 131: loop(true) { ... break } alone
///
@ -66,6 +67,7 @@ impl NormalizationPlan {
note = "Use loop_only() instead. Statement-level normalization makes this obsolete."
)]
#[allow(deprecated)]
#[allow(dead_code)]
pub fn loop_with_post(post_assign_count: usize) -> Self {
// consumed = 1 (loop) + N (assigns) + 1 (return)
let consumed = 1 + post_assign_count + 1;

View File

@ -75,6 +75,7 @@ pub(in crate::mir::builder) enum ScanDirection {
/// This structure contains all the information needed to lower an index_of-style loop.
/// Moved from pattern6_scan_with_init.rs for centralization.
#[derive(Debug, Clone)]
#[allow(dead_code)]
pub(in crate::mir::builder) struct ScanWithInitPlan {
/// Loop variable name (e.g., "i")
pub loop_var: String,
@ -335,6 +336,7 @@ pub(in crate::mir::builder) struct Pattern5InfiniteEarlyExitPlan {
/// CorePlan expressions use **ValueId references only** (no String parsing).
/// This prevents "second language processor" from growing inside Lowerer.
#[derive(Debug, Clone)]
#[allow(dead_code)]
pub(in crate::mir::builder) enum CorePlan {
/// Sequence: execute plans in order
Seq(Vec<CorePlan>),
@ -370,6 +372,7 @@ pub(in crate::mir::builder) struct CorePhiInfo {
/// All fields are now REQUIRED (Option removed for structural SSOT).
/// Legacy fields (header_effects, step_effects, carriers) have been removed.
#[derive(Debug, Clone)]
#[allow(dead_code)]
pub(in crate::mir::builder) struct CoreLoopPlan {
// === Block IDs (pre-allocated by Normalizer) ===
@ -478,6 +481,7 @@ pub(in crate::mir::builder) enum CoreEffectPlan {
/// Phase 273 P1: Exit plan (control flow exit)
#[derive(Debug, Clone)]
#[allow(dead_code)]
pub(in crate::mir::builder) enum CoreExitPlan {
/// Return with optional value
Return(Option<ValueId>),