Extract typed C facts for search and lineage #24
No reviewers
Labels
No labels
area/cli
area/core
area/database
area/indexing
area/query
type/epic
type/feature
type/foundation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
JayKobe6k/ClariTree!24
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-7-c-facts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Tests
nix develop --command cargo fmt --all -- --checknix develop --command cargo lintnix develop --command cargo test --all-targets --all-featuresnix develop --command cargo doc --no-deps --all-featuresnix develop --command cargo check --target x86_64-pc-windows-gnu --all-targets --all-featuresnix develop --command nixfmt --check flake.nixnix flake checkCloses #7
Found two actionable semantic extraction issues.
@ -377,0 +612,4 @@} else if kind == EntityKind::VarDecl {let block = self.ensure_current_block(callable, current)?;let mut context = OperationContext::callable(callable, block);self.lower_initialization(entity, &mut context)?;[P1] Block-scope
staticdeclarations are emitted into the function entry block like automatic initializers, but C initializes these objects once before program start rather than on each function entry. Downstream reaching-definition and lineage analysis will therefore model a fresh assignment on every call. Please represent static-storage initialization outside the per-invocation CFG, or mark it with distinct initialization semantics.@ -377,0 +731,4 @@let Some(declaration) = self.ensure_declaration(entity)? else {return Ok(());};let Some(initializer) = variable_initializer(entity) else {[P1] A variable declaration is lowered only through its initializer, so expressions in variably modified array bounds are skipped. For
int a[bound()], this loses both the call toboundand any identifier uses in the bound, making the call graph and lineage facts incomplete for valid C. Please lower all evaluated declaration expressions, including VLA bounds, while still distinguishing the initializer value.Review comment #931: Fixed in
962b47b. Block-scope static initializers are now translation-unit-owned static-storage operations and skipped by callable CFG lowering; IR validation accepts static-local targets while retaining automatic-local rejection. Focused IR/C-facts tests, full tests, rustdoc, and Windows GNU checks passed.Review comment #929: Fixed in
962b47b. Evaluated VLA bounds are lowered before initializers for locals, block typedefs, pointer/multidimensional VLAs, and definition parameters, while prototypes and constant arrays remain non-executable. The C-facts regression and complete 101-unit/5-integration suite passed.