Clean up IR diagnostics - #8535
Conversation
60d512d to
9f43537
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8535 +/- ##
==========================================
+ Coverage 74.59% 74.70% +0.10%
==========================================
Files 458 460 +2
Lines 62303 62389 +86
==========================================
+ Hits 46476 46608 +132
+ Misses 15827 15781 -46
🚀 New features to boost your workflow:
|
rescript
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
|
||
| let is_artifact filename = | ||
| match Ext_filename.get_extension_maybe filename with | ||
| | ".lam" | ".lambda" | ".jsx" -> true |
There was a problem hiding this comment.
Slightly confusing that some of these files have the extension .jsx, which does not mean React JSX here.
Maybe we could change that extension in a separate PR?
Replace the ambiguous internal -bs-diagnose option with -debug-ir while preserving its role as an umbrella mode that also enables Lam invariant checks. Keep diagnostic state per compilation so reentrant and multi-file compiler processes produce deterministic artifacts. Write Lam and JS snapshots into one <output-prefix>.debug-ir directory, use a unified chronological counter, and remove recognized stale artifacts before each run. Centralize dumping in Ir_diagnostics instead of keeping module-global counters in Lam_util and Js_pass_debug. Remove Js_pass_debug entirely and rename lam_util.cppo.ml now that it no longer contains CPPO directives. Add a build integration test that verifies Lam, grouped-Lam, and JS artifacts, consecutive numbering, stale-artifact cleanup, and removal by rescript clean. Signed-off-by: Cristiano Calcagno <cristianoc@users.noreply.github.com>
Signed-off-by: Cristiano Calcagno <cristianoc@users.noreply.github.com>
9f43537 to
5039bdb
Compare
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-8535 |
Summary
-bs-diagnoseto-debug-irIr_diagnosticscontext<output-prefix>.debug-ir/Js_pass_debugand the no-longer-needed CPPO pass forlam_utilrescript cleanWhy
The old counters lived for the entire compiler process, so names depended on earlier compilations and made reentrant/multi-file use order-dependent. Artifacts were scattered next to source inputs and accumulated stale files. A compiler-owned directory and per-compilation state make the debug facility recognizable, deterministic, and easy to clean.
-debug-irremains an umbrella debug mode and implies Lambda invariant checking, while-check-lamstays independently usable.Validation
make testdebug_irbuild integration testmake checkformatStack
This is PR 2 of 2 and depends on #8534. Its base should be changed to
masterafter #8534 merges.