Skip to content

sa: one ValueEntry per function; drop functions[] - #273

Merged
rieske merged 1 commit into
masterfrom
sa/one-function-value
Sep 3, 2026
Merged

sa: one ValueEntry per function; drop functions[]#273
rieske merged 1 commit into
masterfrom
sa/one-function-value

Conversation

@rieske

@rieske rieske commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Summary

Wave D.1. One file-scope ValueEntry per function. functions[] and the functionDefined set are gone.

  • insertFunction writes the full Function type (including ...) and Storage::Static if internal, else Global.
  • updateFunction refines that same record and keeps linkage.
  • FunctionEntry is a snapshot (FunctionEntry(const ValueEntry&)). hasInternalLinkage() is isStatic().
  • functionDefined_ lives on the ValueEntry, same pattern as definingInitializer.
  • Identifier visit: isBareFunction is enough. Dual-table mismatch error deleted.
  • Designator type keeps the variadic bit.

FunctionEntry stays for FunctionFrame. getDataHomes already skips isFunction().

Not this PR: IdentifierTable vs ValueScope (D.2).

Test plan

  • SymbolTable.insertFunctionValueHasVariadicAndInternalLinkage
  • SymbolTable.updateFunctionRefinesTheSameValueAndKeepsLinkage
  • SymbolTable.functionParameterIsPointerNotHasFunction
  • SymbolTable.markFunctionDefinedIsOnTheRecord
  • SemanticAnalyzer.functionDesignatorKeepsVariadic
  • semantic_analyzerTest (33)
  • CI

File-scope functions live only in ValueScope. insertFunction writes
the full Function type (including ...) and Static storage for
internal linkage. FunctionEntry is a snapshot of that record.
functionDefined_ is on the ValueEntry, not a parallel set.

Identifier visit uses isBareFunction; the dual-table mismatch error
is gone. Designator type keeps the variadic bit.
@mergify

mergify Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 94.288% (+0.02%) from 94.273% — sa/one-function-value into master

@rieske
rieske merged commit 5d98e21 into master Sep 3, 2026
4 checks passed
@rieske
rieske deleted the sa/one-function-value branch September 3, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants