compiler: drop private from three module-crossing declarations#1376
Open
mbouaziz wants to merge 1 commit into
Open
compiler: drop private from three module-crossing declarations#1376mbouaziz wants to merge 1 commit into
private from three module-crossing declarations#1376mbouaziz wants to merge 1 commit into
Conversation
These are declared `private` inside their modules but referenced from outside them, so they were never actually private — module-level `private` is not enforced today (#1343), which is the only reason this compiles. Making them public just states what is already true, ahead of turning that enforcement on. - Config.Config (Config.sk): the shared config record, used as a type in ~20 backend modules (optimize, peephole, AsmOutput, compile, ...). - OuterIstToIR.makeOuterIst, AsmOutput.mangle: internal helpers the driver in compile.sk calls from global scope. (PrettyIR has its own private `mangle`; that one is same-module and stays private.) No behavioural change — the compiler rebuilds itself cleanly. Refs #1343. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prep for enforcing module-level
private(#1343). Three declarations are markedprivateinside their modules but referenced from outside them — so they were never actually private; module-privatesimply isn't enforced today, which is why this compiles at all. This makes them public to state what is already true, so that turning enforcement on later doesn't break the build here.Because the feature is unenforced, this is a no-op at runtime — the compiler rebuilds itself cleanly (verified: a full
make stage1from this source succeeds).Config.ConfigConfig.sk:43config: Config.Config)OuterIstToIR.makeOuterIstOuterIstToIR.sk:4884compile.sk:236(driver, global scope)AsmOutput.mangleAsmOutput.sk:1139compile.sk:618(driver, global scope)Config.Configis a plain mislabel — it's the compiler's shared config record, threaded as a type through the whole backend. The other two are internal helpers the driver legitimately calls. NotePrettyIRhas its ownprivate fun mangle(PrettyIR.sk:626); that one is same-module and stays private — onlyAsmOutput.mangleis the cross-module one.This is the first of the prep PRs from my analysis on #1343 (the harmless un-private migration). The obstack/
gContextSynccross-package reaches are handled separately, by giving SKJSON/SKDB sanctioned SKStore wrappers rather than un-privating the internals.— Claude Opus 4.8 (1M context)