File tree Expand file tree Collapse file tree 8 files changed +22
-18
lines changed
tests/ParallelTypeCheckingTests Expand file tree Collapse file tree 8 files changed +22
-18
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ module internal DependencyResolution =
150150
151151 let fsiFiles =
152152 nodes
153- |> Array.filter ( fun f -> match f.File.AST with | ASTOrX .AST ( ParsedInput.SigFile _) -> true | _ -> false )
153+ |> Array.filter ( fun f -> match f.File.AST with | ASTOrFsix .AST ( ParsedInput.SigFile _) -> true | _ -> false )
154154
155155 let processFile ( node : FileData ) =
156156 let deps =
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ let internal gatherBackingInfo (files : SourceFiles) : Files =
2222 {
2323 Idx = FileIdx.make i
2424 Code = " no code here" // TODO
25- AST = ASTOrX .AST f.AST
25+ AST = ASTOrFsix .AST f.AST
2626 FsiBacked = fsiBacked
2727 }
2828 )
@@ -61,7 +61,7 @@ let gatherForAllFiles (files : SourceFiles) =
6161 files
6262 // TODO Proper async with cancellation
6363 |> Array.Parallel.map ( fun f ->
64- let ast = match f.AST with ASTOrX .AST ast -> ast | X _ -> failwith " Unexpected X item"
64+ let ast = match f.AST with ASTOrFsix .AST ast -> ast | Fsix _ -> failwith " Unexpected X item"
6565 let data = gatherFileData ast
6666 {
6767 File = f
Original file line number Diff line number Diff line change @@ -125,6 +125,7 @@ let CheckMultipleInputsInParallel
125125 let graphDumpName = tcConfig.outputFile |> Option.map Path.GetFileName |> Option.defaultValue " project"
126126 $" {graphDumpName}.deps.json"
127127 graph.Graph
128+ |> Graph.map ( fun n -> n.Name)
128129 |> Graph.serialiseToJson graphDumpPath
129130
130131 let _ = ctok // TODO Use
@@ -151,7 +152,7 @@ let CheckMultipleInputsInParallel
151152 let c = cnt
152153 cnt <- cnt + 1
153154 match file.AST with
154- | ASTOrX .AST _ ->
155+ | ASTOrFsix .AST _ ->
155156 printfn $" #{c} [thread {Thread.CurrentThread.ManagedThreadId}] Type-checking {file.ToString()}"
156157 let! f = CheckOneInput'(
157158 checkForErrors2,
@@ -179,7 +180,7 @@ let CheckMultipleInputsInParallel
179180 // printfn $"Finished applying {file.ToString()}"
180181 partialResult, state
181182 )
182- | ASTOrX.X fsi ->
183+ | ASTOrFsix.Fsix fsi ->
183184 // printfn $"[{c}] Processing X {file.ToString()}"
184185
185186 let hadSig = true
@@ -231,9 +232,9 @@ let CheckMultipleInputsInParallel
231232 let processFile ( file : File ) ( state : State ) : State -> PartialResult * State =
232233 let parsedInput , logger =
233234 match file.AST with
234- | ASTOrX .AST ast ->
235+ | ASTOrFsix .AST ast ->
235236 ast, inputsWithLoggers[ file.Idx] |> snd
236- | ASTOrX.X _ ->
237+ | ASTOrFsix.Fsix _ ->
237238 inputs |> List.item 0 , diagnosticsLogger
238239 processFile file ( parsedInput, logger) state
239240
Original file line number Diff line number Diff line change @@ -31,18 +31,20 @@ type SourceFile =
3131
3232type SourceFiles = SourceFile[]
3333
34- type ASTOrX =
34+ type ASTOrFsix =
35+ // Actual AST of a real file
3536 | AST of AST
36- | X of string
37+ // A dummy file/node we create for performing TcState updates for fsi-backed impl files
38+ | Fsix of string
3739 with
3840 member x.Name =
3941 match x with
4042 | AST ast -> ast.FileName
41- | X qualifiedName -> qualifiedName + " x"
43+ | Fsix qualifiedName -> qualifiedName + " x"
4244 member x.QualifiedName =
4345 match x with
4446 | AST ast -> ast.QualifiedName.Text
45- | X qualifiedName -> qualifiedName + " .fsix"
47+ | Fsix qualifiedName -> qualifiedName + " .fsix"
4648
4749/// Basic data about a parsed source file with extra information needed for graph processing
4850[<CustomEquality; CustomComparison>]
@@ -51,7 +53,7 @@ type File =
5153 /// Order of the file in the project. Files with lower number cannot depend on files with higher number
5254 Idx : FileIdx
5355 Code : string
54- AST : ASTOrX
56+ AST : ASTOrFsix
5557 FsiBacked : bool
5658 }
5759 with
@@ -74,7 +76,7 @@ type File =
7476 {
7577 Idx = idx
7678 Code = " Fake '.fsix' node for dummy .fs state"
77- AST = ASTOrX.X fsi
79+ AST = ASTOrFsix.Fsix fsi
7880 FsiBacked = false
7981 }
8082
Original file line number Diff line number Diff line change 1- .checkouts
1+ .fcs_test
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ type Codebase =
1717
1818let codebases =
1919 [|
20- { WorkDir = $@" {__SOURCE_DIRECTORY__}\.checkouts\fcs \src\compiler" ; Path = $@" {__SOURCE_DIRECTORY__}\FCS.args.txt" ; Limit = None }
21- { WorkDir = $@" {__SOURCE_DIRECTORY__}\.checkouts\fcs \tests\FSharp.Compiler.ComponentTests" ; Path = $@" {__SOURCE_DIRECTORY__}\ComponentTests.args.txt" ; Limit = None }
20+ { WorkDir = $@" {__SOURCE_DIRECTORY__}\.fcs_test \src\compiler" ; Path = $@" {__SOURCE_DIRECTORY__}\FCS.args.txt" ; Limit = None }
21+ { WorkDir = $@" {__SOURCE_DIRECTORY__}\.fcs_test \tests\FSharp.Compiler.ComponentTests" ; Path = $@" {__SOURCE_DIRECTORY__}\ComponentTests.args.txt" ; Limit = None }
2222 |]
2323
2424let internal setupParsed config =
Original file line number Diff line number Diff line change @@ -282,6 +282,7 @@ let ``Analyse whole projects and print statistics`` (projectFile : string) =
282282
283283 let path = $" {Path.GetFileName(projectFile)}.deps.json"
284284 graph.Graph
285+ |> Graph.map ( fun n -> n.Name)
285286 |> Graph.serialiseToJson path
286287
287288 log $" Analysed {N} files, detected {totalDeps}/{maxPossibleDeps} file dependencies (%.1f {100.0 * double(totalDeps) / double(maxPossibleDeps)}%%)."
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ let a = 3
6060 {
6161 Idx = FileIdx.make 1
6262 Code = code
63- AST = ASTOrX .AST <| parseSourceCode ( " A.fs" , code)
63+ AST = ASTOrFsix .AST <| parseSourceCode ( " A.fs" , code)
6464 FsiBacked = false
6565 }
6666
@@ -72,7 +72,7 @@ let b = 3
7272 {
7373 Idx = FileIdx.make 2
7474 Code = code
75- AST = ASTOrX .AST <| parseSourceCode ( " B.fs" , code)
75+ AST = ASTOrFsix .AST <| parseSourceCode ( " B.fs" , code)
7676 FsiBacked = false
7777 }
7878 [|
You can’t perform that action at this time.
0 commit comments