Skip to content

Commit

Permalink
ftms
Browse files Browse the repository at this point in the history
  • Loading branch information
psfinaki committed Dec 18, 2024
1 parent c1cb0ca commit e13c345
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 40 deletions.
2 changes: 1 addition & 1 deletion src/Compiler/Driver/CompilerImports.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ val EncodeTypecheckingData:
tcGlobals: TcGlobals *
generatedCcu: CcuThunk *
outfile: string *
isIncrementalBuild: bool *
isIncrementalBuild: bool *
tcInfo: PickledTcInfo ->
ILResource list

Expand Down
64 changes: 32 additions & 32 deletions src/Compiler/Driver/fsc.fs
Original file line number Diff line number Diff line change
Expand Up @@ -171,57 +171,57 @@ let TypeCheck
let byteReaderA () = ByteMemory.Empty.AsReadOnly()
let byteReaderB = None

let tcInfo =
let tcInfo =
GetTypecheckingData(
assembly.FileName,
assembly.ILScopeRef,
assembly.RawMetadata.TryGetILModuleDef(),
byteReaderA,
byteReaderB)
byteReaderB
)

let rawData = tcInfo.RawData
let topAttrs = {
mainMethodAttrs = rawData.MainMethodAttrs
netModuleAttrs = rawData.NetModuleAttrs
assemblyAttrs = rawData.AssemblyAttrs
}

let topAttrs =
{
mainMethodAttrs = rawData.MainMethodAttrs
netModuleAttrs = rawData.NetModuleAttrs
assemblyAttrs = rawData.AssemblyAttrs
}

// need to understand if anything can be used here, pickling state is hard
tcInitialState,
topAttrs,
topAttrs,
rawData.DeclaredImpls,
// this is quite definitely wrong, need to figure out what to do with the environment
tcInitialState.TcEnvFromImpls

else
let tcState, topAttrs, declaredImpls, tcEnvAtEndOfLastFile = CheckClosedInputSet(
ctok,
diagnosticsLogger.CheckForErrors,
tcConfig,
tcImports,
tcGlobals,
None,
tcInitialState,
eagerFormat,
inputs
)
let tcState, topAttrs, declaredImpls, tcEnvAtEndOfLastFile =
CheckClosedInputSet(
ctok,
diagnosticsLogger.CheckForErrors,
tcConfig,
tcImports,
tcGlobals,
None,
tcInitialState,
eagerFormat,
inputs
)

if false then
let tcInfo = {
MainMethodAttrs = topAttrs.mainMethodAttrs
NetModuleAttrs = topAttrs.netModuleAttrs
AssemblyAttrs = topAttrs.assemblyAttrs
DeclaredImpls = declaredImpls
}
let tcInfo =
{
MainMethodAttrs = topAttrs.mainMethodAttrs
NetModuleAttrs = topAttrs.netModuleAttrs
AssemblyAttrs = topAttrs.assemblyAttrs
DeclaredImpls = declaredImpls
}

// will need to pass results further somewhere
let _typecheckingDataResources = EncodeTypecheckingData(
tcConfig,
tcGlobals,
tcState.Ccu,
outfile,
false,
tcInfo)
let _typecheckingDataResources =
EncodeTypecheckingData(tcConfig, tcGlobals, tcState.Ccu, outfile, false, tcInfo)

()

Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Driver/fsc.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ val internal TypeCheck:
assemblyName: string *
tcEnv0: CheckBasics.TcEnv *
openDecls0: TypedTree.OpenDeclaration list *
inputs: ParsedInput list *
inputs: ParsedInput list *
exiter: Exiter *
outfile: string ->
TcState * TopAttribs * CheckedImplFile list * CheckBasics.TcEnv
Expand Down
11 changes: 5 additions & 6 deletions src/Compiler/TypedTree/TypedTree.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -4297,12 +4297,11 @@ type PickledCcuInfo =
[<DebuggerBrowsable(DebuggerBrowsableState.Never)>]
member DebugText: string
type PickledTcInfo = {
MainMethodAttrs: Attribs
NetModuleAttrs: Attribs
AssemblyAttrs: Attribs
DeclaredImpls: CheckedImplFile list
}
type PickledTcInfo =
{ MainMethodAttrs: Attribs
NetModuleAttrs: Attribs
AssemblyAttrs: Attribs
DeclaredImpls: CheckedImplFile list }
/// Represents a set of free local values. Computed type cached by later phases
/// (never cached type checking). Cached in expressions. Not pickled.
Expand Down

0 comments on commit e13c345

Please sign in to comment.