|
21 | 21 |
|
22 | 22 | **Used by**: `DeadCommon.addDeclaration_`, `DeadType.addTypeDependenciesAcrossFiles`, `DeadValue` path construction. |
23 | 23 |
|
| 24 | +**Status**: ✅ FIXED in Task 1 - explicit `file_context` now threaded through all analysis functions. |
| 25 | + |
24 | 26 | ### P2: Global analysis tables |
25 | 27 | **Problem**: All analysis results accumulate in global hashtables: |
26 | 28 | - `DeadCommon.decls` - all declarations |
|
42 | 44 | ### P4: Global configuration reads |
43 | 45 | **Problem**: Analysis code directly reads `!Common.Cli.debug`, `RunConfig.runConfig.transitive`, etc. scattered throughout. Can't run analysis with different configs without mutating globals. |
44 | 46 |
|
| 47 | +**Status**: ✅ FIXED in Task 2 - explicit `config` now threaded through all analysis functions. |
| 48 | + |
45 | 49 | ### P5: Side effects mixed with analysis |
46 | 50 | **Problem**: Analysis functions directly call: |
47 | 51 | - `Log_.warning` - logging |
@@ -135,10 +139,13 @@ Each task should: |
135 | 139 | **Value**: Makes it possible to process files concurrently or out of order. |
136 | 140 |
|
137 | 141 | **Changes**: |
138 | | -- [ ] Create `DeadFileContext.t` type with `source_path`, `module_name`, `is_interface` fields |
139 | | -- [ ] Thread through `DeadCode.processCmt`, `DeadValue`, `DeadType`, `DeadCommon.addDeclaration_` |
140 | | -- [ ] Remove all reads of `Common.currentSrc`, `currentModule`, `currentModuleName` from DCE code |
141 | | -- [ ] Delete the globals (or mark as deprecated if still used by Exception/Arnold) |
| 142 | +- [x] Create `DeadCommon.FileContext.t` type with `source_path`, `module_name`, `is_interface` fields |
| 143 | +- [x] Thread through `DeadCode.processCmt`, `DeadValue`, `DeadType`, `DeadCommon.addDeclaration_` |
| 144 | +- [x] Thread through `Exception.processCmt`, `Arnold.processCmt` |
| 145 | +- [x] Remove all reads of `Common.currentSrc`, `currentModule`, `currentModuleName` from DCE code |
| 146 | +- [x] Delete the globals `currentSrc`, `currentModule`, `currentModuleName` from `Common.ml` |
| 147 | + |
| 148 | +**Status**: Complete ✅ |
142 | 149 |
|
143 | 150 | **Test**: Run analysis on same files but vary the order - should get identical results. |
144 | 151 |
|
@@ -288,14 +295,15 @@ Each task should: |
288 | 295 |
|
289 | 296 | ## Execution Strategy |
290 | 297 |
|
291 | | -**Recommended order**: 1 → 2 (complete all analyses) → 3 → 4 → 5 → 6 → 7 → 8 → 9 → 10 (verify) → 11 (test) |
| 298 | +**Completed**: Task 1 ✅, Task 2 ✅, Task 10 ✅ |
| 299 | + |
| 300 | +**Remaining order**: 3 → 4 → 5 → 6 → 7 → 8 → 9 → 11 (test) |
292 | 301 |
|
293 | 302 | **Why this order?** |
294 | | -- Tasks 1-2 remove implicit dependencies (file context, config) - these are foundational |
295 | | -- Task 2 must be **fully complete** (DCE + Exception + Arnold) before proceeding |
296 | | -- Tasks 3-7 localize global state - can be done incrementally once inputs are explicit |
| 303 | +- Tasks 1-2 remove implicit dependencies (file context, config) - ✅ DONE |
| 304 | +- Tasks 3-7 localize global state - can be done incrementally now that inputs are explicit |
297 | 305 | - Tasks 8-9 separate pure/impure - can only do this once state is local |
298 | | -- Task 10 verifies no global config reads remain |
| 306 | +- Task 10 verifies no global config reads remain - ✅ DONE |
299 | 307 | - Task 11 validates everything |
300 | 308 |
|
301 | 309 | **Alternative**: Could do 3-7 in any order (they're mostly independent). |
|
0 commit comments