Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions bootstrap/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8096,6 +8096,17 @@ impl RustCodegen {
// ============================================================================

#[derive(Debug, Clone, PartialEq)]
// Variant S (#969 dead-code audit, HIR/FPGA grammar layer): the Hardware IR
// node-kind enums below model the full target HDL/FPGA grammar surface
// (clock/reset kinds, edge sensitivity, always-block statement kinds, memory
// kinds, clock-domain-crossing and FIFO strategies). Several variants are not
// yet constructed by the current lowering passes, so each emits a
// `never constructed` dead_code warning -- but they are an intentional,
// spec-complete AST surface kept for the Phase-0 FPGA foundation, not dead
// code. A targeted per-enum allow documents that without removing any variant
// or weakening the type; same conservative annotate-not-delete pattern as the
// #1111 / #1122 host slices. Scoped narrowly to these enums (NOT the file).
#[allow(dead_code)]
pub enum HwType {
Bits(u32),
UInt(u32),
Expand All @@ -8110,12 +8121,14 @@ pub enum HwType {
}

#[derive(Debug, Clone, PartialEq)]
#[allow(dead_code)]
pub enum HwResetKind {
Async,
Sync,
}

#[derive(Debug, Clone, PartialEq)]
#[allow(dead_code)]
pub enum HwResetPolarity {
ActiveHigh,
ActiveLow,
Expand Down Expand Up @@ -8208,6 +8221,7 @@ pub struct HirAssign {
}

#[derive(Debug, Clone, PartialEq)]
#[allow(dead_code)]
pub enum HwEdge {
Posedge,
Negedge,
Expand All @@ -8223,6 +8237,7 @@ pub struct HirAlwaysBlock {
}

#[derive(Debug, Clone, PartialEq)]
#[allow(dead_code)]
pub enum HirAlwaysStmtKind {
BlockingAssign,
NonBlockingAssign,
Expand Down Expand Up @@ -8250,6 +8265,7 @@ pub struct HirInstance {
}

#[derive(Debug, Clone, PartialEq)]
#[allow(dead_code)]
pub enum HwMemKind {
Bram,
Dram,
Expand Down Expand Up @@ -8429,6 +8445,7 @@ impl HirClockDomain {
}

#[derive(Debug, Clone, PartialEq)]
#[allow(dead_code)]
pub enum HwCrossStrategy {
TwoFlop,
FifoAsync,
Expand All @@ -8444,6 +8461,7 @@ pub struct HirClockCrossing {
}

#[derive(Debug, Clone, PartialEq)]
#[allow(dead_code)]
pub enum HwFifoKind {
Sync,
Async,
Expand Down
7 changes: 7 additions & 0 deletions docs/NOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

Last updated: 2026-06-14

## loop9-s-hir-deadcode-slice -- per-enum allow(dead_code) for HIR/FPGA grammar enums (Closes #1129)

- **WHERE**: bootstrap/src/compiler.rs (HIR/FPGA grammar enums), scripts/warnings-baseline.sh.
- **WHAT**: added a scoped #[allow(dead_code)] to 8 spec-complete HIR/FPGA grammar enums (HwType, HwResetKind, HwResetPolarity, HwEdge, HirAlwaysStmtKind, HwMemKind, HwCrossStrategy, HwFifoKind) and lowered the warnings baseline 655 -> 647.
- **Why** a targeted #969 slice: these variants are an intentionally spec-complete AST surface, not accidental dead code; per-enum suppression (not file-level) keeps it reviewable, same pattern as #1111/#1122. L6 gf16 SSOT untouched; catalog stays 83; no gen/ edits; ASCII-only added lines; no quality claim added. Closes #1129.
- **Anchor**: phi^2 + phi^-2 = 3

## make-verify-umbrella -- single advisory pre-PR umbrella (make verify) (Closes #1124)

- **WHERE**: new `scripts/verify.sh` and the top-level `Makefile` (new `verify` target + `make help` entry).
Expand Down
10 changes: 5 additions & 5 deletions scripts/warnings-baseline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ set -uo pipefail
# (in the same PR) whenever a reviewed slice legitimately lowers it, so the
# meter keeps tracking real progress. Measured precisely from the structured
# JSON diagnostics on master. History: 683 after the host/mod.rs facade slice
# (#1111); 655 after the host/errors.rs catalog slice (variant P, issue #1122)
# annotated its 28 dead_code symbols. (Earlier NOW.md entries quoted ~685/726
# from the cargo summary line, which rounds differently; this script's
# primary-span count is the canonical meter.)
BASELINE=655
# (#1111); 655 after the host/errors.rs catalog slice (variant P, issue #1122);
# 647 after the HIR/FPGA grammar-enum slice (variant S). (Earlier NOW.md entries
# quoted ~685/726 from the cargo summary line, which rounds differently; this
# script's primary-span count is the canonical meter.)
BASELINE=647

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
Expand Down
Loading