Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc02602a

Browse files
authored
Merge pull requestdotnet#4786 from Microsoft/merges/master-to-dev15.8
Merge master to dev15.8
2 parents4c270d8 +931f546 commitc02602a

File tree

12 files changed

+237
-241
lines changed

12 files changed

+237
-241
lines changed

‎src/absil/illex.fsl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ let eval = function
8787
| 'a' -> 10 | 'b' -> 11 | 'c' -> 12 | 'd' -> 13 | 'e' -> 14 | 'f' -> 15
8888
| _ -> failwith "bad hexbyte"
8989

90-
let kwdOrInstrOrId s =if (Lazy.force kwdInstrTable).ContainsKey s then kwdOrInstr s else VAL_ID s
90+
let kwdOrInstrOrId s =match (Lazy.force kwdInstrTable).TryFind swith Some v -> v | _ -> VAL_ID s
9191

9292
}
9393

‎src/absil/ilread.fs‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3281,8 +3281,8 @@ and seekReadTopExportedTypes (ctxt: ILMetadataReader) =
32813281
])
32823282

32833283
#if!FX_NO_PDB_READER
3284-
letgetPdbReaderpdbPath fileName=
3285-
matchpdbPathwith
3284+
letgetPdbReaderpdbDirPath fileName=
3285+
matchpdbDirPathwith
32863286
| None-> None
32873287
| Some pdbpath->
32883288
try
@@ -3694,7 +3694,7 @@ let openMetadataReader (fileName, mdfile: BinaryFile, metadataPhysLoc, peinfo, p
36943694
// read of the AbsIL module.
36953695
// ----------------------------------------------------------------------
36963696

3697-
letopenPEFileReader(fileName,pefile:BinaryFile,pdbPath)=
3697+
letopenPEFileReader(fileName,pefile:BinaryFile,pdbDirPath)=
36983698
letpev= pefile.GetView()
36993699
(* MSDOS HEADER*)
37003700
letpeSignaturePhysLoc= seekReadInt32 pev0x3c
@@ -3861,13 +3861,13 @@ let openPEFileReader (fileName, pefile: BinaryFile, pdbPath) =
38613861
// Set up the PDB reader so we can read debug info for methods.
38623862
// ----------------------------------------------------------------------
38633863
#if FX_NO_PDB_READER
3864-
letpdb= ignorepdbPath; None
3864+
letpdb= ignorepdbDirPath; None
38653865
#else
38663866
letpdb=
38673867
if runningOnMonothen
38683868
None
38693869
else
3870-
getPdbReaderpdbPath fileName
3870+
getPdbReaderpdbDirPath fileName
38713871
#endif
38723872

38733873
letpectxt:PEReader=
@@ -3891,8 +3891,8 @@ let openPEFileReader (fileName, pefile: BinaryFile, pdbPath) =
38913891
letpeinfo=(subsys,(subsysMajor, subsysMinor), useHighEnthropyVA, ilOnly, only32, is32bitpreferred, only64, platform, isDll, alignVirt, alignPhys, imageBaseReal)
38923892
(metadataPhysLoc, metadataSize, peinfo, pectxt, pev, pdb)
38933893

3894-
letopenPE(fileName,pefile,pdbPath,reduceMemoryUsage,ilGlobals)=
3895-
let(metadataPhysLoc,_metadataSize,peinfo,pectxt,pev,pdb)= openPEFileReader(fileName, pefile,pdbPath)
3894+
letopenPE(fileName,pefile,pdbDirPath,reduceMemoryUsage,ilGlobals)=
3895+
let(metadataPhysLoc,_metadataSize,peinfo,pectxt,pev,pdb)= openPEFileReader(fileName, pefile,pdbDirPath)
38963896
letilModule,ilAssemblyRefs= openMetadataReader(fileName, pefile, metadataPhysLoc, peinfo, pectxt, pev, Some pectxt, reduceMemoryUsage, ilGlobals)
38973897
ilModule, ilAssemblyRefs, pdb
38983898

@@ -3919,7 +3919,7 @@ type MetadataOnlyFlag = Yes | No
39193919
typeReduceMemoryFlag= Yes| No
39203920

39213921
typeILReaderOptions=
3922-
{pdbPath:string option
3922+
{pdbDirPath:string option
39233923
ilGlobals:ILGlobals
39243924
reduceMemoryUsage:ReduceMemoryFlag
39253925
metadataOnly:MetadataOnlyFlag
@@ -3969,7 +3969,7 @@ let tryMemoryMapWholeFile opts fileName =
39693969

39703970
letOpenILModuleReaderFromBytes fileName bytes opts=
39713971
letpefile= ByteFile(fileName, bytes):> BinaryFile
3972-
letilModule,ilAssemblyRefs,pdb= openPE(fileName, pefile, opts.pdbPath,(opts.reduceMemoryUsage= ReduceMemoryFlag.Yes), opts.ilGlobals)
3972+
letilModule,ilAssemblyRefs,pdb= openPE(fileName, pefile, opts.pdbDirPath,(opts.reduceMemoryUsage= ReduceMemoryFlag.Yes), opts.ilGlobals)
39733973
new ILModuleReader(ilModule, ilAssemblyRefs,(fun()-> ClosePdbReader pdb))
39743974

39753975
letOpenILModuleReader fileName opts=
@@ -3978,7 +3978,7 @@ let OpenILModuleReader fileName opts =
39783978
try
39793979
letfullPath= FileSystem.GetFullPathShim(fileName)
39803980
letwriteTime= FileSystem.GetLastWriteTimeShim(fileName)
3981-
letkey= ILModuleReaderCacheKey(fullPath, writeTime, opts.ilGlobals.primaryAssemblyScopeRef, opts.pdbPath.IsSome, opts.reduceMemoryUsage, opts.metadataOnly)
3981+
letkey= ILModuleReaderCacheKey(fullPath, writeTime, opts.ilGlobals.primaryAssemblyScopeRef, opts.pdbDirPath.IsSome, opts.reduceMemoryUsage, opts.metadataOnly)
39823982
key,true
39833983
with exn->
39843984
System.Diagnostics.Debug.Assert(false, sprintf"Failed to compute key in OpenILModuleReader cache for '%s'. Falling back to uncached. Error =%s" fileName(exn.ToString()))
@@ -3987,7 +3987,7 @@ let OpenILModuleReader fileName opts =
39873987

39883988
letcacheResult=
39893989
if keyOkthen
3990-
if opts.pdbPath.IsSomethen None// can't used a cached entry when reading PDBs, since it makes the returned object IDisposable
3990+
if opts.pdbDirPath.IsSomethen None// can't used a cached entry when reading PDBs, since it makes the returned object IDisposable
39913991
else ilModuleReaderCacheLock.AcquireLock(fun ltok-> ilModuleReaderCache.TryGet(ltok, key))
39923992
else
39933993
None
@@ -3999,7 +3999,7 @@ let OpenILModuleReader fileName opts =
39993999
letreduceMemoryUsage=(opts.reduceMemoryUsage= ReduceMemoryFlag.Yes)
40004000
letmetadataOnly=(opts.metadataOnly= MetadataOnlyFlag.Yes)
40014001

4002-
if reduceMemoryUsage&& opts.pdbPath.IsNonethen
4002+
if reduceMemoryUsage&& opts.pdbDirPath.IsNonethen
40034003

40044004
// This case is used in FCS applications, devenv.exe and fsi.exe
40054005
//
@@ -4058,11 +4058,11 @@ let OpenILModuleReader fileName opts =
40584058
letdisposer={new IDisposablewithmember__.Dispose()=()}
40594059
disposer, pefile
40604060

4061-
letilModule,ilAssemblyRefs,pdb= openPE(fullPath, pefile, opts.pdbPath, reduceMemoryUsage, opts.ilGlobals)
4061+
letilModule,ilAssemblyRefs,pdb= openPE(fullPath, pefile, opts.pdbDirPath, reduceMemoryUsage, opts.ilGlobals)
40624062
letilModuleReader=new ILModuleReader(ilModule, ilAssemblyRefs,(fun()-> ClosePdbReader pdb))
40634063

40644064
// Readers with PDB reader disposal logic don't go in the cache. Note the PDB reader is only used in static linking.
4065-
if keyOk&& opts.pdbPath.IsNonethen
4065+
if keyOk&& opts.pdbDirPath.IsNonethen
40664066
ilModuleReaderCacheLock.AcquireLock(fun ltok-> ilModuleReaderCache.Put(ltok, key, ilModuleReader))
40674067

40684068
ilModuleReader

‎src/absil/ilread.fsi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type internal MetadataOnlyFlag = Yes | No
4444
typeinternalReduceMemoryFlag= Yes| No
4545

4646
typeinternalILReaderOptions=
47-
{pdbPath:string option
47+
{pdbDirPath:string option
4848

4949
ilGlobals:ILGlobals
5050

‎src/fsharp/CompileOps.fs‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2626,7 +2626,7 @@ type TcConfigBuilder =
26262626
ri, fileNameOfPath ri, ILResourceAccess.Public
26272627

26282628

2629-
letOpenILBinary(filename,reduceMemoryUsage,ilGlobalsOpt,pdbPathOption,shadowCopyReferences,tryGetMetadataSnapshot)=
2629+
letOpenILBinary(filename,reduceMemoryUsage,ilGlobalsOpt,pdbDirPath,shadowCopyReferences,tryGetMetadataSnapshot)=
26302630
letilGlobals=
26312631
// ILScopeRef.Local can be used only for primary assembly (mscorlib or System.Runtime) itself
26322632
// Remaining assemblies should be opened using existing ilGlobals (so they can properly locate fundamental types)
@@ -2638,7 +2638,7 @@ let OpenILBinary(filename, reduceMemoryUsage, ilGlobalsOpt, pdbPathOption, shado
26382638
{ ilGlobals= ilGlobals
26392639
metadataOnly= MetadataOnlyFlag.Yes
26402640
reduceMemoryUsage= reduceMemoryUsage
2641-
pdbPath=pdbPathOption
2641+
pdbDirPath=pdbDirPath
26422642
tryGetMetadataSnapshot= tryGetMetadataSnapshot}
26432643

26442644
letlocation=
@@ -2700,7 +2700,7 @@ type AssemblyResolution =
27002700
| Some aref-> aref
27012701
| None->
27022702
letreaderSettings:ILReaderOptions=
2703-
{pdbPath=None
2703+
{pdbDirPath=None
27042704
ilGlobals= EcmaMscorlibILGlobals
27052705
reduceMemoryUsage= reduceMemoryUsage
27062706
metadataOnly= MetadataOnlyFlag.Yes
@@ -4061,7 +4061,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
40614061
letopts:ILReaderOptions=
40624062
{ ilGlobals= g.ilg
40634063
reduceMemoryUsage= tcConfig.reduceMemoryUsage
4064-
pdbPath= None
4064+
pdbDirPath= None
40654065
metadataOnly= MetadataOnlyFlag.Yes
40664066
tryGetMetadataSnapshot= tcConfig.tryGetMetadataSnapshot}
40674067
letreader= OpenILModuleReaderFromBytes fileName bytes opts
@@ -4132,20 +4132,21 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
41324132
try
41334133
CheckDisposed()
41344134
lettcConfig= tcConfigP.Get(ctok)
4135-
letpdbPathOption=
4135+
letpdbDirPath=
41364136
// We open the pdb file if one exists parallel to the binary we
41374137
// are reading, so that --standalone will preserve debug information.
41384138
if tcConfig.openDebugInformationForLaterStaticLinkingthen
4139-
letpdbDir=(try Filename.directoryName filenamewith_->".")
4140-
letpdbFile=(try Filename.chopExtension filenamewith_-> filename)+".pdb"
4141-
if FileSystem.SafeExists pdbFilethen
4139+
letpdbDir=try Filename.directoryName filenamewith_->"."
4140+
letpdbFile=(try Filename.chopExtension filenamewith_-> filename)+".pdb"
4141+
4142+
if FileSystem.SafeExists(pdbFile)then
41424143
if verbosethen dprintf"reading PDB file%s from directory%s\n" pdbFile pdbDir
41434144
Some pdbDir
4144-
else
4145-
None
4146-
else
4145+
else
4146+
None
4147+
else
41474148
None
4148-
letilILBinaryReader= OpenILBinary(filename, tcConfig.reduceMemoryUsage, ilGlobalsOpt,pdbPathOption, tcConfig.shadowCopyReferences, tcConfig.tryGetMetadataSnapshot)
4149+
letilILBinaryReader= OpenILBinary(filename, tcConfig.reduceMemoryUsage, ilGlobalsOpt,pdbDirPath, tcConfig.shadowCopyReferences, tcConfig.tryGetMetadataSnapshot)
41494150
tcImports.AttachDisposeAction(fun _->(ilILBinaryReader:> IDisposable).Dispose())
41504151
ilILBinaryReader.ILModuleDef, ilILBinaryReader.ILAssemblyRefs
41514152
with e->

‎src/fsharp/IlxGen.fs‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2474,27 +2474,27 @@ and GenUntupledArgExpr cenv cgbuf eenv m argInfos expr sequel =
24742474
andGenApp cenv cgbuf eenv(f,fty,tyargs,args,m)sequel=
24752475
match(f,tyargs,args)with
24762476
(* Look for tailcall to turn into branch*)
2477-
|(Expr.Val(v,_,_),_,_)when
2478-
((ListAssoc.containsKey cenv.g.valRefEq v eenv.innerVals)&&
2479-
not v.IsConstructor&&
2480-
let(kind,_)= ListAssoc.find cenv.g.valRefEq v eenv.innerVals
2481-
(* when branch-calling methods we must have the right type parameters*)
2482-
beginmatch kindwith
2483-
| BranchCallClosure_->true
2484-
| BranchCallMethod(_,_,tps,_,_)->
2485-
(List.lengthsEqAndForall2(fun ty tp-> typeEquiv cenv.g ty(mkTyparTy tp)) tyargs tps)
2486-
end&&
2487-
(* must be exact #args, ignoring tupling - we untuple if needed below*)
2488-
(letarityInfo=
2489-
match kindwith
2490-
| BranchCallClosure arityInfo
2491-
| BranchCallMethod(arityInfo,_,_,_,_)-> arityInfo
2492-
arityInfo.Length= args.Length
2493-
)&&
2494-
(* no tailcall out of exception handler, etc.*)
2495-
(match sequelIgnoringEndScopesAndDiscard sequelwith Return| ReturnVoid->true|_->false))
2477+
|(Expr.Val(v,_,_),_,_)when
2478+
matchListAssoc.tryFind cenv.g.valRefEq v eenv.innerValswith
2479+
| Some(kind,_)->
2480+
(not v.IsConstructor&&
2481+
(* when branch-calling methods we must have the right type parameters*)
2482+
(match kindwith
2483+
| BranchCallClosure_->true
2484+
| BranchCallMethod(_,_,tps,_,_)->
2485+
(List.lengthsEqAndForall2(fun ty tp-> typeEquiv cenv.g ty(mkTyparTy tp)) tyargs tps))&&
2486+
(* must be exact #args, ignoring tupling - we untuple if needed below*)
2487+
(letarityInfo=
2488+
match kindwith
2489+
| BranchCallClosure arityInfo
2490+
| BranchCallMethod(arityInfo,_,_,_,_)-> arityInfo
2491+
arityInfo.Length= args.Length
2492+
)&&
2493+
(* no tailcall out of exception handler, etc.*)
2494+
(match sequelIgnoringEndScopesAndDiscard sequelwith Return| ReturnVoid->true|_->false))
2495+
| None->false
24962496
->
2497-
let(kind,mark)= ListAssoc.find cenv.g.valRefEq v eenv.innerVals
2497+
let(kind,mark)= ListAssoc.find cenv.g.valRefEq v eenv.innerVals// already checked above in when guard
24982498
letntmargs=
24992499
match kindwith
25002500
| BranchCallClosure arityInfo->

‎src/fsharp/NameResolution.fs‎

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4445,21 +4445,12 @@ let rec GetCompletionForItem (ncenv: NameResolver) (nenv: NameResolutionEnv) m a
44454445
else Seq.empty)
44464446

44474447
// Look for values called 'id' that accept the dot-notation
4448-
letvalues,isItemVal=
4449-
(if nenv.eUnqualifiedItems.ContainsKey(id)then
4450-
// v.lookup : member of a value
4451-
letv= nenv.eUnqualifiedItems.[id]
4452-
match vwith
4453-
| Item.Value x->
4454-
lettyp= x.Type
4455-
lettyp=if x.BaseOrThisInfo= CtorThisVal&& isRefCellTy g typthen destRefCellTy g typelse typ
4456-
(ResolvePartialLongIdentInTypeForItem ncenv nenv m adfalse rest item typ),true
4457-
|_-> Seq.empty,false
4458-
else Seq.empty,false)
4459-
4460-
yield! values
4461-
4462-
ifnot isItemValthen
4448+
match Map.tryFind id nenv.eUnqualifiedItemswith
4449+
| Some(Item.Value x)->
4450+
lettyp= x.Type
4451+
lettyp=if x.BaseOrThisInfo= CtorThisVal&& isRefCellTy g typthen destRefCellTy g typelse typ
4452+
yield! ResolvePartialLongIdentInTypeForItem ncenv nenv m adfalse rest item typ
4453+
|_->
44634454
// type.lookup : lookup a static something in a type
44644455
for tcrefin LookupTypeNameInEnvNoArity OpenQualified id nenvdo
44654456
lettcref= ResolveNestedTypeThroughAbbreviation ncenv tcref m

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp