Skip to content

Commit 356af5c

Browse files
authored
Merge pull request #15147 from dotnet/merges/main-to-release/dev17.7
Merge main to release/dev17.7
2 parents 1bbbdb3 + 04618b0 commit 356af5c

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

src/Compiler/Service/IncrementalBuild.fs

+9-14
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ module IncrementalBuilderStateHelpers =
914914
return! prevBoundModel.Next(syntaxTree)
915915
})
916916

917-
let rec createFinalizeBoundModelGraphNode (initialState: IncrementalBuilderInitialState) (boundModels: GraphNode<BoundModel> seq) =
917+
let createFinalizeBoundModelGraphNode (initialState: IncrementalBuilderInitialState) (boundModels: GraphNode<BoundModel> seq) =
918918
GraphNode(node {
919919
use _ = Activity.start "GetCheckResultsAndImplementationsForProject" [|Activity.Tags.project, initialState.outfile|]
920920
let! result =
@@ -928,7 +928,7 @@ module IncrementalBuilderStateHelpers =
928928
return result, DateTime.UtcNow
929929
})
930930

931-
and computeStampedFileNames (initialState: IncrementalBuilderInitialState) (state: IncrementalBuilderState) (cache: TimeStampCache) =
931+
let computeStampedFileNames (initialState: IncrementalBuilderInitialState) (state: IncrementalBuilderState) (cache: TimeStampCache) =
932932
let slots =
933933
if initialState.useChangeNotifications then
934934
state.slots
@@ -967,7 +967,7 @@ module IncrementalBuilderStateHelpers =
967967
else
968968
state
969969

970-
and computeStampedReferencedAssemblies (initialState: IncrementalBuilderInitialState) state canTriggerInvalidation (cache: TimeStampCache) =
970+
let computeStampedReferencedAssemblies (initialState: IncrementalBuilderInitialState) state canTriggerInvalidation (cache: TimeStampCache) =
971971
let stampedReferencedAssemblies = state.stampedReferencedAssemblies.ToBuilder()
972972

973973
let mutable referencesUpdated = false
@@ -1132,11 +1132,6 @@ type IncrementalBuilder(initialState: IncrementalBuilderInitialState, state: Inc
11321132
do! setCurrentState currentState cache ct
11331133
}
11341134

1135-
let checkFileTimeStampsSynchronously cache =
1136-
checkFileTimeStamps cache
1137-
|> Async.AwaitNodeCode
1138-
|> Async.RunSynchronously
1139-
11401135
do IncrementalBuilderEventTesting.MRU.Add(IncrementalBuilderEventTesting.IBECreated)
11411136

11421137
member _.TcConfig = tcConfig
@@ -1192,10 +1187,10 @@ type IncrementalBuilder(initialState: IncrementalBuilderInitialState, state: Inc
11921187

11931188
member builder.TryGetCheckResultsBeforeFileInProject fileName =
11941189
let cache = TimeStampCache defaultTimeStamp
1195-
checkFileTimeStampsSynchronously cache
1190+
let tmpState = computeStampedFileNames initialState currentState cache
11961191

11971192
let slotOfFile = builder.GetSlotOfFileName fileName
1198-
match tryGetBeforeSlot currentState slotOfFile with
1193+
match tryGetBeforeSlot tmpState slotOfFile with
11991194
| Some(boundModel, timestamp) ->
12001195
let projectTimeStamp = builder.GetLogicalTimeStampForFileInProject(fileName)
12011196
Some (PartialCheckResults (boundModel, timestamp, projectTimeStamp))
@@ -1277,12 +1272,12 @@ type IncrementalBuilder(initialState: IncrementalBuilderInitialState, state: Inc
12771272

12781273
member _.GetLogicalTimeStampForFileInProject(slotOfFile: int) =
12791274
let cache = TimeStampCache defaultTimeStamp
1280-
checkFileTimeStampsSynchronously cache
1281-
computeProjectTimeStamp currentState slotOfFile
1275+
let tempState = computeStampedFileNames initialState currentState cache
1276+
computeProjectTimeStamp tempState slotOfFile
12821277

12831278
member _.GetLogicalTimeStampForProject(cache) =
1284-
checkFileTimeStampsSynchronously cache
1285-
computeProjectTimeStamp currentState -1
1279+
let tempState = computeStampedFileNames initialState currentState cache
1280+
computeProjectTimeStamp tempState -1
12861281

12871282
member _.TryGetSlotOfFileName(fileName: string) =
12881283
// Get the slot of the given file and force it to build.

src/Compiler/Service/IncrementalBuild.fsi

+5-2
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,18 @@ type internal IncrementalBuilder =
185185
/// This is safe for use from non-compiler threads but the objects returned must in many cases be accessed only from the compiler thread.
186186
member GetCheckResultsForFileInProjectEvenIfStale: fileName: string -> PartialCheckResults option
187187

188+
// TODO: Looks like the following doc does not match the actual method or it's signature.
189+
188190
/// Get the preceding typecheck state of a slot, but only if it is up-to-date w.r.t.
189191
/// the timestamps on files and referenced DLLs prior to this one. Return None if the result is not available.
190192
/// This is a relatively quick operation.
191193
///
192194
/// This is safe for use from non-compiler threads
193195
member AreCheckResultsBeforeFileInProjectReady: fileName: string -> bool
194196

195-
/// Get the preceding typecheck state of a slot, WITH checking if it is up-to-date w.r.t. However, files will not be parsed or checked.
196-
/// the timestamps on files and referenced DLLs prior to this one. Return None if the result is not available or if it is not up-to-date.
197+
/// Get the preceding typecheck state of a slot, WITH checking if it is up-to-date w.r.t. the timestamps of files and referenced DLLs prior to this one.
198+
/// However, files will not be parsed or checked.
199+
/// Return None if the result is not available or if it is not up-to-date.
197200
///
198201
/// This is safe for use from non-compiler threads but the objects returned must in many cases be accessed only from the compiler thread.
199202
member TryGetCheckResultsBeforeFileInProject: fileName: string -> PartialCheckResults option

0 commit comments

Comments
 (0)