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

Commit4a052ae

Browse files
authored
Span: complete matrix of tests (#5092)
* complete matrix of tests* add struct fields to test matrix* update baselines
1 parentfd3d906 commit4a052ae

21 files changed

+716
-123
lines changed

‎src/fsharp/AttributeChecking.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ let CheckFSharpAttributes g attribs m =
291291
match namedArgswith
292292
| ExtractAttribNamedArg"IsError"(AttribBoolArg v)-> v
293293
|_->false
294-
if isErrorthen ErrorD msgelse WarnD msg
294+
if isError&&(not g.compilingFslib|| n<>1204)then ErrorD msgelse WarnD msg
295295

296296
|_->
297297
CompleteD

‎src/fsharp/ConstraintSolver.fs‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,9 @@ let isIntegerTy g ty =
267267
isUnsignedIntegerTy g ty
268268

269269
letisStringTy g ty= typeEquiv g g.string_ty ty
270+
270271
letisCharTy g ty= typeEquiv g g.char_ty ty
272+
271273
letisBoolTy g ty= typeEquiv g g.bool_ty ty
272274

273275
/// float or float32 or float<_> or float32<_>
@@ -890,9 +892,9 @@ and SolveTypSubsumesTyp (csenv:ConstraintSolverEnv) ndeep m2 (trace: OptionalTra
890892
|[ h1; tag1],[ h2; tag2]->
891893
SolveTypEqualsTyp csenv ndeep m2 trace None h1 h2++(fun()->
892894
match stripTyEqnsA csenv.g canShortcut tag1, stripTyEqnsA csenv.g canShortcut tag2with
893-
| TType_app(tagc1,[]), TType_app(tagc2,choices)
894-
when(tyconRefEq g tagc2 g.choice2_tcr&&
895-
choices|> List.exists(function AppTy g(choicetc,[])-> tyconRefEq g tagc1choicetc|_->false))-> CompleteD
895+
| TType_app(tagc1,[]), TType_app(tagc2,[])
896+
when(tyconRefEq g tagc2 g.byrefkind_InOut_tcr&&
897+
(tyconRefEq g tagc1 g.byrefkind_In_tcr|| tyconRefEq g tagc1g.byrefkind_Out_tcr))-> CompleteD
896898
|_-> SolveTypEqualsTyp csenv ndeep m2 trace cxsln tag1 tag2)
897899
|_-> SolveTypEqualsTypEqns csenv ndeep m2 trace cxsln l1 l2
898900

@@ -2682,7 +2684,7 @@ let CodegenWitnessThatTypSupportsTraitConstraint tcVal g amap m (traitInfo:Trait
26822684
// the address of the object then go do that
26832685
if minfo.IsStruct&& minfo.IsInstance&&(match argExprswith[]->false| h::_->not(isByrefTy g(tyOfExpr g h)))then
26842686
leth,t= List.headAndTail argExprs
2685-
letwrap,h',_readonly= mkExprAddrOfExpr gtruefalse PossiblyMutates h None m
2687+
letwrap,h',_readonly,_writeonly= mkExprAddrOfExpr gtruefalse PossiblyMutates h None m
26862688
ResultD(Some(wrap(Expr.Op(TOp.TraitCall(traitInfo),[],(h':: t), m))))
26872689
else
26882690
ResultD(Some(MakeMethInfoCall amap m minfo methArgTys argExprs))
@@ -2697,7 +2699,7 @@ let CodegenWitnessThatTypSupportsTraitConstraint tcVal g amap m (traitInfo:Trait
26972699
// the address of the object then go do that
26982700
if rfref.Tycon.IsStructOrEnumTycon&&not(isByrefTy g(tyOfExpr g argExprs.[0]))then
26992701
leth= List.head argExprs
2700-
letwrap,h',_readonly= mkExprAddrOfExpr gtruefalse DefinitelyMutates h None m
2702+
letwrap,h',_readonly,_writeonly= mkExprAddrOfExpr gtruefalse DefinitelyMutates h None m
27012703
Some(wrap(mkRecdFieldSetViaExprAddr(h', rfref, tinst, argExprs.[1], m)))
27022704
else
27032705
Some(mkRecdFieldSetViaExprAddr(argExprs.[0], rfref, tinst, argExprs.[1], m))

‎src/fsharp/FSharp.Core/FSharp.Core.fsproj‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<OutputType>Library</OutputType>
1717
<AssemblyName>FSharp.Core</AssemblyName>
1818
<DefineConstants>FSHARP_CORE;$(DefineConstants)</DefineConstants>
19+
<DefineConstantsCondition=" '$(Configuration)' == 'Proto'">BUILDING_WITH_LKG;$(DefineConstants)</DefineConstants>
1920
<NoWarn>$(NoWarn);45;55;62;75;1204</NoWarn>
2021
<BaseAddress>0x05000000</BaseAddress>
2122
<CompilingFsLib>true</CompilingFsLib>

‎src/fsharp/FSharp.Core/prim-types-prelude.fs‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,6 @@ namespace Microsoft.FSharp.Core
6464

6565
typearray<'T>= 'T[]
6666

67-
/// <summary>Represents a managed pointer in F# code.</summary>
68-
typebyref<'T,'Kind>=(#"!0&" #)
69-
70-
/// <summary>Represents a managed pointer in F# code. For F# 4.5+ this is considered equivalent to <c>byref&lt'T, ByRefKinds.InOut&gt</c></summary>
71-
typebyref<'T>=(#"!0&" #)
72-
7367
typenativeptr<'Twhen'T:unmanaged>=(#"native int" #)
7468

7569
typevoidptr=(#"void*" #)

‎src/fsharp/FSharp.Core/prim-types-prelude.fsi‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,6 @@ namespace Microsoft.FSharp.Core
228228
/// values.</remarks>
229229
type'Tarray= 'T[]
230230

231-
/// <summary>Represents a managed pointer in F# code.</summary>
232-
typebyref<'T,'Kind>=(#"!0&" #)
233-
234-
/// <summary>Represents a managed pointer in F# code. For F# 4.5+ this is considered equivalent to <c>byref&lt'T, ByRefKinds.InOut&gt</c></summary>
235-
typebyref<'T>=(#"!0&" #)
236-
237231
/// <summary>Represents an unmanaged pointer in F# code.</summary>
238232
///
239233
/// <remarks>This type should only be used when writing F# code that interoperates

‎src/fsharp/FSharp.Core/prim-types.fs‎

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,33 @@ namespace Microsoft.FSharp.Core
347347
[<MeasureAnnotatedAbbreviation>]typeint16<[<Measure>]'Measure>= int16
348348
[<MeasureAnnotatedAbbreviation>]typeint64<[<Measure>]'Measure>= int64
349349

350+
/// <summary>Represents a managed pointer in F# code.</c></summary>
351+
typebyref<'T>=(#"!0&" #)
352+
353+
/// <summary>Represents a managed pointer in F# code.</summary>
354+
typebyref<'T,'Kind>=(#"!0&" #)
355+
356+
/// Represents the types of byrefs in F# 4.5+
357+
moduleByRefKinds=
358+
359+
/// Represents a byref that can be written
360+
[<Sealed>]
361+
typeOut()=classend
362+
363+
/// Represents a byref that can be read
364+
[<Sealed>]
365+
typeIn()=classend
366+
367+
/// Represents a byref that can be both read and written
368+
[<Sealed>]
369+
typeInOut=classend
370+
371+
/// <summary>Represents a in-argument or readonly managed pointer in F# code. This type should only be used with F# 4.5+.</summary>
372+
typeinref<'T>= byref<'T, ByRefKinds.In>
373+
374+
/// <summary>Represents a out-argument managed pointer in F# code. This type should only be used with F# 4.5+.</summary>
375+
typeoutref<'T>= byref<'T, ByRefKinds.Out>
376+
350377
#if FX_RESHAPED_REFLECTION
351378
modulePrimReflectionAdapters=
352379

@@ -511,10 +538,10 @@ namespace Microsoft.FSharp.Core
511538
//Byrefusagechecksprohibittypeinstantiationsinvolvingbyrefs.
512539

513540
[<NoDynamicInvocation>]
514-
letinline(~&)(obj: 'T):'Tbyref=
541+
letinline(~&)(obj: 'T):byref<'T>=
515542
ignoreobj//pretendthevariableisused
516543
lete=newSystem.ArgumentException(ErrorStrings.AddressOpNotFirstClassString)
517-
(#"throw"(e:> System.Exception):'T byref#)
544+
(#"throw"(e:> System.Exception):byref<'T>#)
518545

519546
[<NoDynamicInvocation>]
520547
letinline(~&&)(obj: 'T):nativeptr<'T>=
@@ -5652,24 +5679,6 @@ namespace Microsoft.FSharp.Core
56525679
if n>=0then PowDecimal x nelse1.0M/ PowDecimal x n)
56535680

56545681

5655-
/// Represents the types of byrefs in F# 4.5+
5656-
moduleByRefKinds=
5657-
5658-
/// Represents a byref that can be written
5659-
typeOut()=classend
5660-
5661-
/// Represents a byref that can be read
5662-
typeIn()=classend
5663-
5664-
/// Represents a byref that can be both read and written
5665-
typeInOut= Choice<In, Out>
5666-
5667-
/// <summary>Represents a in-argument or readonly managed pointer in F# code. This type should only be used with F# 4.5+.</summary>
5668-
typeinref<'T>= byref<'T, ByRefKinds.In>
5669-
5670-
/// <summary>Represents a out-argument managed pointer in F# code. This type should only be used with F# 4.5+.</summary>
5671-
typeoutref<'T>= byref<'T, ByRefKinds.Out>
5672-
56735682
namespaceMicrosoft.FSharp.Control
56745683

56755684
openSystem

‎src/fsharp/FSharp.Core/prim-types.fsi‎

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,55 @@ namespace Microsoft.FSharp.Core
800800
/// <c>System.Int64</c>.</summary>
801801
typeint64<[<Measure>]'Measure>= int64
802802

803+
/// <summary>Represents a managed pointer in F# code.</summary>
804+
#if BUILDING_WITH_LKG|| BUILD_FROM_SOURCE
805+
[<CompilerMessage("This construct is for use in the FSharp.Core library and should not be used directly",1204, IsHidden=true)>]
806+
#else
807+
[<CompilerMessage("This construct is for use in the FSharp.Core library and should not be used directly",1204, IsHidden=true, IsError=true)>]
808+
#endif
809+
typebyref<'T,'Kind>=(#"!0&" #)
810+
811+
/// <summary>Represents a managed pointer in F# code. For F# 4.5+ this is considered equivalent to <c>byref&lt'T, ByRefKinds.InOut&gt</c></summary>
812+
typebyref<'T>=(#"!0&" #)
813+
814+
/// Represents the types of byrefs in F# 4.5+
815+
#if BUILDING_WITH_LKG|| BUILD_FROM_SOURCE
816+
[<CompilerMessage("This construct is for use in the FSharp.Core library and should not be used directly",1204, IsHidden=true)>]
817+
#else
818+
[<CompilerMessage("This construct is for use in the FSharp.Core library and should not be used directly",1204, IsHidden=true, IsError=true)>]
819+
#endif
820+
moduleByRefKinds=
821+
822+
/// Represents a byref that can be written
823+
#if BUILDING_WITH_LKG|| BUILD_FROM_SOURCE
824+
[<CompilerMessage("This construct is for use in the FSharp.Core library and should not be used directly",1204, IsHidden=true)>]
825+
#else
826+
[<CompilerMessage("This construct is for use in the FSharp.Core library and should not be used directly",1204, IsHidden=true, IsError=true)>]
827+
#endif
828+
typeOut
829+
830+
/// Represents a byref that can be read
831+
#if BUILDING_WITH_LKG|| BUILD_FROM_SOURCE
832+
[<CompilerMessage("This construct is for use in the FSharp.Core library and should not be used directly",1204, IsHidden=true)>]
833+
#else
834+
[<CompilerMessage("This construct is for use in the FSharp.Core library and should not be used directly",1204, IsHidden=true, IsError=true)>]
835+
#endif
836+
typeIn
837+
838+
/// Represents a byref that can be both read and written
839+
#if BUILDING_WITH_LKG|| BUILD_FROM_SOURCE
840+
[<CompilerMessage("This construct is for use in the FSharp.Core library and should not be used directly",1204, IsHidden=true)>]
841+
#else
842+
[<CompilerMessage("This construct is for use in the FSharp.Core library and should not be used directly",1204, IsHidden=true, IsError=true)>]
843+
#endif
844+
typeInOut
845+
846+
/// <summary>Represents a in-argument or readonly managed pointer in F# code. This type should only be used with F# 4.5+.</summary>
847+
typeinref<'T>= byref<'T, ByRefKinds.In>
848+
849+
/// <summary>Represents a out-argument managed pointer in F# code. This type should only be used with F# 4.5+.</summary>
850+
typeoutref<'T>= byref<'T, ByRefKinds.Out>
851+
803852
/// <summary>Language primitives associated with the F# language</summary>
804853
moduleLanguagePrimitives=
805854

@@ -1097,7 +1146,7 @@ namespace Microsoft.FSharp.Core
10971146
///<param name="obj">The input object.</param>
10981147
///<returns>The managed pointer.</returns>
10991148
[<NoDynamicInvocation>]
1100-
val inline( ~&):obj:'T->'T byref
1149+
val inline( ~&):obj:'T->byref<'T>
11011150

11021151
///<summary>Address-of. Uses of this value may result in the generation of unverifiable code.</summary>
11031152
///<param name="obj">The input object.</param>
@@ -1659,24 +1708,6 @@ namespace Microsoft.FSharp.Core
16591708
///<returns>The optimized function.</returns>
16601709
new:unit->FSharpFunc<'T1,'T2,'T3,'T4,'T5,'U>
16611710

1662-
///Represents the types of byrefs in F#4.5+
1663-
module ByRefKinds=
1664-
1665-
///Represents a byref that can be written
1666-
type Out=class end
1667-
1668-
///Represents a byref that can be read
1669-
type In=class end
1670-
1671-
///Represents a byref that can be both read and written
1672-
type InOut=Choice<In,Out>
1673-
1674-
///<summary>Represents a in-argument or readonly managed pointer in F#code. This type should only be used with F#4.5+.</summary>
1675-
type inref<'T>=byref<'T,ByRefKinds.In>
1676-
1677-
///<summary>Represents a out-argument managed pointer in F#code. This type should only be used with F#4.5+.</summary>
1678-
type outref<'T>=byref<'T,ByRefKinds.Out>
1679-
16801711
///<summary>The type of mutable references. Use the functions[!]and[:=]to get and
16811712
///set values of this type.</summary>
16821713
[<StructuralEquality;StructuralComparison>]

‎src/fsharp/MethodCalls.fs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ let TakeObjAddrForMethodCall g amap (minfo:MethInfo) isMutable m objArgs f =
581581
lethasCallInfo= ccallInfo.IsSome
582582
letmustTakeAddress= hasCallInfo|| minfo.ObjArgNeedsAddress(amap, m)
583583
letobjArgTy= tyOfExpr g objArgExpr
584-
letwrap,objArgExpr',_readonly= mkExprAddrOfExpr g mustTakeAddress hasCallInfo isMutable objArgExpr None m
584+
letwrap,objArgExpr',_readonly,_writeonly= mkExprAddrOfExpr g mustTakeAddress hasCallInfo isMutable objArgExpr None m
585585

586586
// Extension members and calls to class constraints may need a coercion for their object argument
587587
letobjArgExpr'=
@@ -1104,7 +1104,7 @@ module ProvidedMethodCalls =
11041104
match ea.PApplyOption((function ProvidedAddressOfExpr x-> Some x|_-> None), m)with
11051105
| Some e->
11061106
leteT= exprToExpr e
1107-
letwrap,ce,_readonly= mkExprAddrOfExpr gtruefalse DefinitelyMutates eT None m
1107+
letwrap,ce,_readonly,_writeonly= mkExprAddrOfExpr gtruefalse DefinitelyMutates eT None m
11081108
letce= wrap ce
11091109
None,(ce, tyOfExpr g ce)
11101110
| None->

‎src/fsharp/Optimizer.fs‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,11 +2273,11 @@ and TakeAddressOfStructArgumentIfNeeded cenv (vref:ValRef) ty args m =
22732273
if vref.IsInstanceMember&& isStructTy cenv.g tythen
22742274
match argswith
22752275
| objArg::rest->
2276-
//REVIEW: weset NeverMutates. This is valid because we only ever use DevirtualizeApplication to transform
2276+
//Weset NeverMutates here, allowing more address-taking. This is valid because we only ever use DevirtualizeApplication to transform
22772277
// known calls to known generated F# code for CompareTo, Equals and GetHashCode.
22782278
// If we ever reuse DevirtualizeApplication to transform an arbitrary virtual call into a
22792279
// direct call then this assumption is not valid.
2280-
letwrap,objArgAddress,_readonly= mkExprAddrOfExpr cenv.gtruefalse NeverMutates objArg None m
2280+
letwrap,objArgAddress,_readonly,_writeonly= mkExprAddrOfExpr cenv.gtruefalse NeverMutates objArg None m
22812281
wrap,(objArgAddress::rest)
22822282
|_->
22832283
// no wrapper, args stay the same
@@ -2289,8 +2289,6 @@ and DevirtualizeApplication cenv env (vref:ValRef) ty tyargs args m =
22892289
letwrap,args= TakeAddressOfStructArgumentIfNeeded cenv vref ty args m
22902290
lettransformedExpr= wrap(MakeApplicationAndBetaReduce cenv.g(exprForValRef m vref, vref.Type,(if isNil tyargsthen[]else[tyargs]), args, m))
22912291
OptimizeExpr cenv env transformedExpr
2292-
2293-
22942292

22952293
andTryDevirtualizeApplication cenv env(f,tyargs,args,m)=
22962294
match f, tyargs, argswith

‎src/fsharp/PatternMatchCompilation.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ let CompilePatternBasic
904904
when isNil topgtvs&& ucref.Tycon.IsStructRecordOrUnionTycon->
905905

906906
letargexp= GetSubExprOfInput subexpr
907-
letvOpt,addrexp,_readonly= mkExprAddrOfExprAux gtruefalse NeverMutates argexp None matchm
907+
letvOpt,addrexp,_readonly,_writeonly= mkExprAddrOfExprAux gtruefalse NeverMutates argexp None matchm
908908
match vOptwith
909909
| None-> Some addrexp, None
910910
| Some(v,e)->

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp