Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/fsharp/CompileOps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3713,10 +3713,6 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
| None -> false
| None -> false

member tcImports.SetBase(baseTcImports) =
CheckDisposed()
importsBase <- Some(baseTcImports)

member private tcImports.Base =
CheckDisposed()
importsBase
Expand Down
1 change: 0 additions & 1 deletion src/fsharp/CompileOps.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,6 @@ type TcAssemblyResolutions =
type TcImports =
interface System.IDisposable
//new : TcImports option -> TcImports
member SetBase : TcImports -> unit
member DllTable : NameMap<ImportedBinary> with get
member GetImportedAssemblies : unit -> ImportedAssembly list
member GetCcusInDeclOrder : unit -> CcuThunk list
Expand Down
14 changes: 12 additions & 2 deletions src/fsharp/TcGlobals.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1336,25 +1336,35 @@ let mkTcGlobals (compilingFslib,sysCcu,ilg,fslibCcu,directoryToResolveRelativePa
// the TyconRef's we have in our hands, hence we can't dereference them to find their stamps.

// So this dictionary is indexed by names.
//
// Make it lazy to avoid dereferencing while setting up the base imports.
let dict =
lazy
entries
|> List.map (fun (nm,tcref,builder) -> nm, (fun tcref2 tinst -> if tyconRefEq tcref tcref2 then Some(builder tinst) else None))
|> Dictionary.ofList
(fun tcref tinst ->
if dict.ContainsKey tcref.LogicalName then dict.[tcref.LogicalName] tcref tinst
let dict = dict.Value
let key = tcref.LogicalName
if dict.ContainsKey key then dict.[key] tcref tinst
else None )
else
// This map is for use in normal times (not building FSharp.Core.dll). It is indexed by tcref stamp which is
// faster than the indexing technique used in the case above.
//
// So this dictionary is indexed by integers.
//
// Make it lazy to avoid dereferencing while setting up the base imports.
let dict =
lazy
entries
|> List.filter (fun (_,tcref,_) -> tcref.CanDeref)
|> List.map (fun (_,tcref,builder) -> tcref.Stamp, builder)
|> Dictionary.ofList
(fun tcref2 tinst ->
if dict.ContainsKey tcref2.Stamp then Some(dict.[tcref2.Stamp] tinst)
let dict = dict.Value
let key = tcref2.Stamp
if dict.ContainsKey key then Some(dict.[key] tinst)
else None)
end

Expand Down