Skip to content

Commit 29947aa

Browse files
committed
Updates
1 parent 5cdbf44 commit 29947aa

File tree

7 files changed

+15
-27
lines changed

7 files changed

+15
-27
lines changed

Diff for: src/Compiler/Driver/ParseAndCheckInputs.fs

-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ open FSharp.Compiler.LexerStore
3131
open FSharp.Compiler.Lexhelp
3232
open FSharp.Compiler.NameResolution
3333
open FSharp.Compiler.ParseHelpers
34-
open FSharp.Compiler.ReuseTcResults
3534
open FSharp.Compiler.Syntax
3635
open FSharp.Compiler.SyntaxTrivia
3736
open FSharp.Compiler.Syntax.PrettyNaming
@@ -1962,9 +1961,6 @@ let CheckMultipleInputsUsingGraphMode
19621961

19631962
let CheckClosedInputSet (ctok, checkForErrors, tcConfig: TcConfig, tcImports, tcGlobals, prefixPathOpt, tcState, eagerFormat, inputs) =
19641963

1965-
if tcConfig.reuseTcResults = ReuseTcResults.On then
1966-
CachingDriver(tcConfig).TryReuseTcResults(inputs)
1967-
19681964
// tcEnvAtEndOfLastFile is the environment required by fsi.exe when incrementally adding definitions
19691965
let results, tcState =
19701966
match tcConfig.typeCheckingConfig.Mode with

Diff for: src/Compiler/Driver/ReuseTcResults/CachingDriver.fs

+4-7
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ type CachingDriver(tcConfig: TcConfig) =
113113

114114
let getThisCompilationReferences = Seq.map formatAssemblyReference >> Seq.toArray
115115

116-
member _.TryReuseTcResults inputs =
116+
member _.CanReuseTcResults inputs =
117117
let prevTcDataOpt = readPrevTcData ()
118118

119119
let thisTcData =
@@ -129,14 +129,11 @@ type CachingDriver(tcConfig: TcConfig) =
129129

130130
if prevTcData = thisTcData then
131131
use _ = Activity.start Activity.Events.reuseTcResultsCacheHit []
132-
133-
() // do nothing, yet
132+
true
134133
else
135134
use _ = Activity.start Activity.Events.reuseTcResultsCacheMissed []
136-
137-
writeThisTcData thisTcData
135+
false
138136

139137
| None ->
140138
use _ = Activity.start Activity.Events.reuseTcResultsCacheAbsent []
141-
142-
writeThisTcData thisTcData
139+
false

Diff for: src/Compiler/Driver/ReuseTcResults/CachingDriver.fsi

-11
This file was deleted.

Diff for: src/Compiler/Driver/fsc.fs

+7-2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ open FSharp.Compiler.TypedTree
5454
open FSharp.Compiler.TypedTreeOps
5555
open FSharp.Compiler.XmlDocFileWriter
5656
open FSharp.Compiler.CheckExpressionsOps
57+
open ReuseTcResults
5758

5859
//----------------------------------------------------------------------------
5960
// Reporting - warnings, errors
@@ -162,6 +163,11 @@ let TypeCheck
162163

163164
let eagerFormat (diag: PhasedDiagnostic) = diag.EagerlyFormatCore true
164165

166+
let cachingDriver = CachingDriver(tcConfig)
167+
if cachingDriver.CanReuseTcResults(inputs) then
168+
// do nothing, yet
169+
()
170+
165171
CheckClosedInputSet(
166172
ctok,
167173
diagnosticsLogger.CheckForErrors,
@@ -171,8 +177,7 @@ let TypeCheck
171177
None,
172178
tcInitialState,
173179
eagerFormat,
174-
inputs
175-
)
180+
inputs)
176181
with exn ->
177182
errorRecovery exn rangeStartup
178183
exiter.Exit 1

Diff for: src/Compiler/FSharp.Compiler.Service.fsproj

+1-2
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,9 @@
462462
<Compile Include="Driver\GraphChecking\GraphProcessing.fsi" />
463463
<Compile Include="Driver\GraphChecking\GraphProcessing.fs" />
464464
<Content Include="Driver\GraphChecking\Docs.md" />
465-
<Compile Include="Driver\ReuseTcResults\CachingDriver.fsi" />
466-
<Compile Include="Driver\ReuseTcResults\CachingDriver.fs" />
467465
<Compile Include="Driver\ParseAndCheckInputs.fsi" />
468466
<Compile Include="Driver\ParseAndCheckInputs.fs" />
467+
<Compile Include="Driver\ReuseTcResults\CachingDriver.fs" />
469468
<Compile Include="Driver\ScriptClosure.fsi" />
470469
<Compile Include="Driver\ScriptClosure.fs" />
471470
<Compile Include="Driver\CompilerOptions.fsi" />

Diff for: tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@
262262
<Compile Include="Interop\ParamArray.fs" />
263263
<Compile Include="Interop\Literals.fs" />
264264
<Compile Include="Scripting\Interactive.fs" />
265-
<Compile Include="TypeChecks\ReuseTcResults\ReuseTcResultsTests.fs" />
265+
<Compile Include="TypeChecks\ReuseTcResults\Activities.fs" />
266266
<Compile Include="TypeChecks\SeqTypeCheckTests.fs" />
267267
<Compile Include="TypeChecks\CheckDeclarationsTests.fs" />
268268
<Compile Include="TypeChecks\Graph\Utils.fs" />

Diff for: tests/FSharp.Compiler.ComponentTests/TypeChecks/ReuseTcResults/ReuseTcResultsTests.fs renamed to tests/FSharp.Compiler.ComponentTests/TypeChecks/ReuseTcResults/Activities.fs

+2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ open System.Diagnostics
55
open System.IO
66

77
open FSharp.Compiler.Diagnostics
8+
open FSharp.Test
89
open FSharp.Test.Compiler
910

1011
open Xunit
1112

1213
open TestFramework
1314

1415

16+
[<Collection(nameof NotThreadSafeResourceCollection)>]
1517
type Activities() =
1618

1719
let tempPath = $"{getTemporaryFileName()}.fsx"

0 commit comments

Comments
 (0)