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

Commitae23973

Browse files
committed
F# source merge of r67146 fromhttp://fsharppowerpack.codeplex.com/ plus fixes for mono
Original merge courtesy of Mohamed Suhaib Fahad <mohamedsuhaiba@live.in>
1 parent6d4f78d commitae23973

File tree

220 files changed

+4055
-1235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+4055
-1235
lines changed

‎config.make.in‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,15 @@ DEFINES_2_0 = \
5959
--define:FX_FSLIB_STRUCTURAL_EQUALITY \
6060
--define:FX_FSLIB_IOBSERVABLE \
6161
--define:FX_FSLIB_TUPLE \
62-
--define:FX_FSLIB_LAZY
62+
--define:FX_FSLIB_LAZY \
63+
--define:FX_NO_CANCELLATIONTOKEN_CLASSES \
64+
--define:FX_NO_TASK
6365

6466
DEFINES_4_0 = \
6567
$(DEFINES_GENERAL) \
6668
$(DEFINES_DEBUG) \
67-
--define:FX_ATLEAST_40
69+
--define:FX_ATLEAST_40 \
70+
--define:BE_SECURITY_TRANSPARENT
6871

6972
REFERENCES_2_0 = \
7073
-r:$(monolibdir)Microsoft.Build.Engine.dll \

‎src/FSharpSource.Settings.targets‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!--
3-
# Copyright (c) 2002-2010 Microsoft Corporation.
3+
# Copyright (c) 2002-2011 Microsoft Corporation.
44
#
55
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
66
# copy of the license can be found in the License.html file at the root of this distribution.

‎src/FSharpSource.targets‎

Lines changed: 264 additions & 21 deletions
Large diffs are not rendered by default.

‎src/absil/bytes.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//----------------------------------------------------------------------------
22
//
3-
// Copyright (c) 2002-2010 Microsoft Corporation.
3+
// Copyright (c) 2002-2011 Microsoft Corporation.
44
//
55
// This source code is subject to terms and conditions of the Apache License, Version 2.0. A
66
// copy of the license can be found in the License.html file at the root of this distribution.

‎src/absil/bytes.fsi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//----------------------------------------------------------------------------
22
//
3-
// Copyright (c) 2002-2010 Microsoft Corporation.
3+
// Copyright (c) 2002-2011 Microsoft Corporation.
44
//
55
// This source code is subject to terms and conditions of the Apache License, Version 2.0. A
66
// copy of the license can be found in the License.html file at the root of this distribution.

‎src/absil/il.fs‎

Lines changed: 77 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//----------------------------------------------------------------------------
22
//
3-
// Copyright (c) 2002-2010 Microsoft Corporation.
3+
// Copyright (c) 2002-2011 Microsoft Corporation.
44
//
55
// This source code is subject to terms and conditions of the Apache License, Version 2.0. A
66
// copy of the license can be found in the License.html file at the root of this distribution.
@@ -341,6 +341,20 @@ type ILAssemblyRef(data) =
341341
assemRefLocale=locale;}
342342

343343
static memberFromAssembly(assembly:System.Reflection.Assembly)=
344+
// SILVERLIGHT-TODO: Needs to account for empty versions, public keys
345+
#if SILVERLIGHT
346+
letfullName= assembly.ToString()
347+
letcomponents= fullName.Split([|','|])
348+
// name, version, culture, public key token
349+
letnm= components.[0]
350+
letv= System.Version(components.[1].Split([|'='|]).[1])
351+
letversion:ILVersionInfo option= Some((uint16 v.Major,uint16 v.Minor,uint16 v.Build,uint16 v.Revision))
352+
letkeyString= components.[3].Split([|'='|]).[1]
353+
letkeyBytes= Bytes.stringAsUtf8NullTerminated keyString
354+
letkey= Some(PublicKeyToken(keyBytes.[0..keyBytes.Length-2]))// remove null terminator
355+
ILAssemblyRef.Create(nm,None,key,false,version,None)
356+
357+
#else
344358
letaname= assembly.GetName()
345359
letlocale= None
346360
//match aname.CultureInfo with
@@ -361,6 +375,7 @@ type ILAssemblyRef(data) =
361375
| v-> Some(uint16 v.Major,uint16 v.Minor,uint16 v.Build,uint16 v.Revision)
362376

363377
ILAssemblyRef.Create(aname.Name,None,publicKey,false,version,locale)
378+
#endif
364379

365380
memberaref.QualifiedName=
366381
letb=new System.Text.StringBuilder(100)
@@ -757,6 +772,9 @@ type ILAttribElem =
757772
typeILAttributeNamedArg=(string* ILType* bool* ILAttribElem)
758773
typeILAttribute=
759774
{ Method:ILMethodSpec;
775+
#if SILVERLIGHT
776+
Arguments:ILAttribElem list* ILAttributeNamedArg list
777+
#endif
760778
Data:byte[]}
761779

762780
[<NoEquality; NoComparison>]
@@ -1829,9 +1847,6 @@ let mkILFieldRef(tref,nm,ty) = { EnclosingTypeRef=tref; Name=nm; Type=ty}
18291847

18301848
letmkILFieldSpec(tref,ty)={ FieldRef= tref; EnclosingType=ty}
18311849

1832-
letmkILFieldSpec_in_tspec(tspec:ILTypeSpec,boxity,nm,ty)=
1833-
mkILFieldSpec(mkILFieldRef(tspec.TypeRef,nm,ty), mkILTy boxity tspec)
1834-
18351850
letmkILFieldSpecInTy(typ:ILType,nm,fty)=
18361851
mkILFieldSpec(mkILFieldRef(typ.TypeRef,nm,fty), typ)
18371852

@@ -2243,6 +2258,7 @@ let tname_RuntimeFieldHandle = "System.RuntimeFieldHandle"
22432258
typeILGlobals=
22442259
{ mscorlibScopeRef:ILScopeRef;
22452260
mscorlibAssemblyName:string;
2261+
noDebugData:bool;
22462262
tref_Object:ILTypeRef
22472263
; tspec_Object:ILTypeSpec
22482264
; typ_Object:ILType
@@ -2311,7 +2327,10 @@ type ILGlobals =
23112327
; typ_StreamingContext:ILType
23122328
; tref_SecurityPermissionAttribute:ILTypeRef
23132329
; tspec_Exception:ILTypeSpec
2314-
; typ_Exception:ILType}
2330+
; typ_Exception:ILType
2331+
;mutable generatedAttribsCache:ILAttribute list
2332+
;mutable debuggerBrowsableNeverAttributeCache:ILAttribute option
2333+
;mutable debuggerTypeProxyAttributeCache:ILAttribute option}
23152334
overridex.ToString()="<ILGlobals>"
23162335

23172336
letmkNormalCall mspec= I_call(Normalcall, mspec, None)
@@ -2323,7 +2342,7 @@ let ldarg_1 = I_ldarg 1us
23232342
lettname_CompilerGeneratedAttribute="System.Runtime.CompilerServices.CompilerGeneratedAttribute"
23242343
lettname_DebuggableAttribute="System.Diagnostics.DebuggableAttribute"
23252344

2326-
letmkILGlobals mscorlibScopeRef mscorlib_assembly_name_option=
2345+
letmkILGlobals mscorlibScopeRef mscorlib_assembly_name_optionnoDebugData=
23272346
letmscorlibAssemblyName=
23282347
match mscorlib_assembly_name_optionwith
23292348
| Some name-> name
@@ -2473,8 +2492,9 @@ let mkILGlobals mscorlibScopeRef mscorlib_assembly_name_option =
24732492
lettref_RuntimeFieldHandle= mkILTyRef(mscorlibScopeRef,tname_RuntimeFieldHandle)
24742493
lettspec_RuntimeFieldHandle= mkILTySpec(tref_RuntimeFieldHandle,emptyILGenericArgs)
24752494
lettyp_RuntimeFieldHandle= ILType.Value tspec_RuntimeFieldHandle
2476-
{ mscorlibScopeRef=mscorlibScopeRef
2477-
; mscorlibAssemblyName=mscorlibAssemblyName
2495+
{ mscorlibScopeRef=mscorlibScopeRef
2496+
; mscorlibAssemblyName=mscorlibAssemblyName
2497+
; noDebugData=noDebugData
24782498
; tref_Object=tref_Object
24792499
; tspec_Object=tspec_Object
24802500
; typ_Object=typ_Object
@@ -2544,15 +2564,18 @@ let mkILGlobals mscorlibScopeRef mscorlib_assembly_name_option =
25442564
; typ_StreamingContext=typ_StreamingContext
25452565
; tref_SecurityPermissionAttribute=tref_SecurityPermissionAttribute
25462566
; tspec_Exception=tspec_Exception
2547-
; typ_Exception=typ_Exception}
2567+
; typ_Exception=typ_Exception
2568+
; generatedAttribsCache=[]
2569+
; debuggerBrowsableNeverAttributeCache= None
2570+
; debuggerTypeProxyAttributeCache= None}
25482571

25492572

25502573
(* NOTE: ecma_ prefix refers to the standard "mscorlib"*)
25512574
letecmaPublicKey= PublicKeyToken(Bytes.ofInt32Array[|0xde;0xad;0xbe;0xef;0xca;0xfe;0xfa;0xce|])
25522575

25532576
letecmaMscorlibScopeRef= ILScopeRef.Assembly(ILAssemblyRef.Create("mscorlib", None, Some ecmaPublicKey,true, None, None))
25542577

2555-
letecmaILGlobals= mkILGlobals ecmaMscorlibScopeRef None
2578+
letecmaILGlobals= mkILGlobals ecmaMscorlibScopeRef Nonefalse
25562579

25572580
letmkInitializeArrayMethSpec ilg=
25582581
mkILNonGenericStaticMethSpecInTy(mkILNonGenericBoxedTy(mkILTyRef(ilg.mscorlibScopeRef,"System.Runtime.CompilerServices.RuntimeHelpers")),"InitializeArray",[ilg.typ_Array;ilg.typ_RuntimeFieldHandle], ILType.Void)
@@ -3859,7 +3882,11 @@ let sigptr_get_intarray n (bytes:byte[]) sigptr =
38593882

38603883
letsigptr_get_string n bytes sigptr=
38613884
letintarray,sigptr= sigptr_get_intarray n bytes sigptr
3885+
#if SILVERLIGHT
3886+
System.Text.Encoding.UTF8.GetString(intarray,0, intarray.Length), sigptr
3887+
#else
38623888
System.Text.Encoding.UTF8.GetString intarray, sigptr
3889+
#endif
38633890

38643891
letsigptr_get_z_i32 bytes sigptr=
38653892
letb0,sigptr= sigptr_get_byte bytes sigptr
@@ -4084,6 +4111,11 @@ let encodeCustomAttrNamedArg ilg (nm, ty, prop, elem) =
40844111
yield! encodeCustomAttrValue ilg ty elem|]
40854112

40864113
letmkILCustomAttribMethRef(ilg:ILGlobals)(mspec:ILMethodSpec,fixedArgs:list<_>,namedArgs:list<_>)=
4114+
#if SILVERLIGHT
4115+
{ Method= mspec;
4116+
Arguments= fixedArgs, namedArgs
4117+
Data=[||]}
4118+
#else
40874119
letargtys= mspec.MethodRef.ArgTypes
40884120
letargs=
40894121
[|yield![|0x01uy;0x00uy;|]
@@ -4095,6 +4127,7 @@ let mkILCustomAttribMethRef (ilg: ILGlobals) (mspec:ILMethodSpec, fixedArgs: lis
40954127

40964128
{ Method= mspec;
40974129
Data= args}
4130+
#endif
40984131

40994132
letmkILCustomAttribute ilg(tref,argtys,argvs,propvs)=
41004133
mkILCustomAttribMethRef ilg(mkILNonGenericCtorMethSpec(tref,argtys),argvs,propvs)
@@ -4125,21 +4158,42 @@ let typ_DebuggerBrowsableState ilg =
41254158
ILType.Value(mkILTySpec(tref_DebuggerBrowsableState,emptyILGenericArgs))
41264159

41274160
letmkCompilerGeneratedAttribute ilg= mkILCustomAttribute ilg(tref_CompilerGeneratedAttribute ilg,[],[],[])
4161+
letmkDebuggerNonUserCodeAttribute ilg= mkILCustomAttribute ilg(tref_DebuggerNonUserCodeAttribute ilg,[],[],[])
41284162
letmkDebuggerHiddenAttribute ilg= mkILCustomAttribute ilg(tref_DebuggerHiddenAttribute ilg,[],[],[])
41294163
letmkDebuggerDisplayAttribute ilg s= mkILCustomAttribute ilg(tref_DebuggerDisplayAttribute ilg,[ilg.typ_String],[ILAttribElem.String(Some s)],[])
4130-
letmkDebuggerTypeProxyAttribute ilg(ty:ILType)= mkILCustomAttribute ilg(tref_DebuggerTypeProxyAttribute ilg,[ilg.typ_Type],[ILAttribElem.TypeRef(Some ty.TypeRef)],[])
4164+
letmkDebuggerTypeProxyAttribute ilg(ty:ILType)=
4165+
match ilg.debuggerTypeProxyAttributeCachewith
4166+
| None->
4167+
letres= mkILCustomAttribute ilg(tref_DebuggerTypeProxyAttribute ilg,[ilg.typ_Type],[ILAttribElem.TypeRef(Some ty.TypeRef)],[])
4168+
ilg.debuggerTypeProxyAttributeCache<- Some res
4169+
res
4170+
| Some res-> res
4171+
41314172
letmkDebuggerBrowsableAttribute ilg n= mkILCustomAttribute ilg(tref_DebuggerBrowsableAttribute ilg,[typ_DebuggerBrowsableState ilg],[ILAttribElem.Int32 n],[])
4132-
letmkDebuggerBrowsableNeverAttribute ilg= mkDebuggerBrowsableAttribute ilg0
4133-
letmkDebuggerBrowsableCollapsedAttribute ilg= mkDebuggerBrowsableAttribute ilg2
4134-
letmkDebuggerBrowsableRootHiddenAttribute ilg= mkDebuggerBrowsableAttribute ilg3
4135-
letmkDebuggerNonUserCodeAttribute ilg= mkILCustomAttribute ilg(tref_DebuggerNonUserCodeAttribute ilg,[],[],[])
4173+
letmkDebuggerBrowsableNeverAttribute ilg=
4174+
match ilg.debuggerBrowsableNeverAttributeCachewith
4175+
| None->
4176+
letres= mkDebuggerBrowsableAttribute ilg0
4177+
ilg.debuggerBrowsableNeverAttributeCache<- Some res
4178+
res
4179+
| Some res-> res
41364180
letmkDebuggerStepThroughAttribute ilg= mkILCustomAttribute ilg(tref_DebuggerStepThroughAttribute ilg,[],[],[])
41374181
letmkDebuggableAttribute ilg(jitTracking,jitOptimizerDisabled)=
41384182
mkILCustomAttribute ilg(tref_DebuggableAttribute ilg,[ilg.typ_Bool;ilg.typ_Bool],[ILAttribElem.Bool jitTracking; ILAttribElem.Bool jitOptimizerDisabled],[])
41394183

41404184

41414185
// Bug 2129. Requests attributes to be added to compiler generated methods
4142-
letadd_generated_attrs ilg(attrs:ILAttributes)= mkILCustomAttrs(attrs.AsList@[mkCompilerGeneratedAttribute ilg;mkDebuggerNonUserCodeAttribute ilg])
4186+
letadd_generated_attrs ilg(attrs:ILAttributes)=
4187+
letattribs=
4188+
match ilg.generatedAttribsCachewith
4189+
|[]->
4190+
letres=[ifnot ilg.noDebugDatathen
4191+
yield mkCompilerGeneratedAttribute ilg
4192+
yield mkDebuggerNonUserCodeAttribute ilg]
4193+
ilg.generatedAttribsCache<- res
4194+
res
4195+
| res-> res
4196+
mkILCustomAttrs(attrs.AsList@ attribs)
41434197

41444198
letaddMethodGeneratedAttrs ilg(mdef:ILMethodDef)={mdefwith CustomAttrs= add_generated_attrs ilg mdef.CustomAttrs}
41454199
letaddPropertyGeneratedAttrs ilg(pdef:ILPropertyDef)={pdefwith CustomAttrs= add_generated_attrs ilg pdef.CustomAttrs}
@@ -4548,9 +4602,14 @@ let parseILVersion (vstr : string) =
45484602
vstr<- System.String.Join(".",versionComponents);
45494603

45504604
letversion= System.Version(vstr)
4551-
letzero16 n=if n<0sthen0uselse uint16(n)
45524605
letzero32 n=if n<0then0uselse uint16(n)
4553-
(zero32 version.Major, zero32 version.Minor, zero32 version.Build, zero16 version.MinorRevision);;
4606+
// since the minor revision will be -1 if none is specified, we need to truncate to 0 to not break existing code
4607+
#if SILVERLIGHT
4608+
letminorRevision=if versionComponents.Length<4then0uselse uint16(version.Revision)
4609+
#else
4610+
letminorRevision=if versionComponents.Length<4then0uselse uint16(version.MinorRevision)
4611+
#endif
4612+
(zero32 version.Major, zero32 version.Minor, zero32 version.Build, minorRevision);;
45544613

45554614

45564615
letcompareILVersions(a1,a2,a3,a4)((b1,b2,b3,b4):ILVersionInfo)=

‎src/absil/il.fsi‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//----------------------------------------------------------------------------
22
//
3-
// Copyright (c) 2002-2010 Microsoft Corporation.
3+
// Copyright (c) 2002-2011 Microsoft Corporation.
44
//
55
// This source code is subject to terms and conditions of the Apache License, Version 2.0. A
66
// copy of the license can be found in the License.html file at the root of this distribution.
@@ -988,6 +988,9 @@ type ILAttributeNamedArg = string * ILType * bool * ILAttribElem
988988
/// to ILAttribElem's as best as possible.
989989
typeILAttribute=
990990
{ Method:ILMethodSpec;
991+
#if SILVERLIGHT
992+
Arguments:ILAttribElem list* ILAttributeNamedArg list
993+
#endif
991994
Data:byte[]}
992995

993996
[<NoEquality; NoComparison; Sealed>]
@@ -1615,6 +1618,7 @@ val ungenericizeTypeName: string -> string (* e.g. List`1 --> List *)
16151618
type ILGlobals=
16161619
{ mscorlibScopeRef:ILScopeRef
16171620
mscorlibAssemblyName:string
1621+
noDebugData:bool;// REVIEW-HOST: this needs to be in cenv - I'm placing it here to make the shelveset smaller
16181622
tref_Object:ILTypeRef
16191623
tspec_Object:ILTypeSpec
16201624
typ_Object:ILType
@@ -1683,10 +1687,13 @@ type ILGlobals =
16831687
typ_StreamingContext:ILType
16841688
tref_SecurityPermissionAttribute:ILTypeRef
16851689
tspec_Exception:ILTypeSpec
1686-
typ_Exception:ILType}
1690+
typ_Exception:ILType
1691+
mutable generatedAttribsCache:ILAttribute list
1692+
mutable debuggerBrowsableNeverAttributeCache:ILAttribute option
1693+
mutable debuggerTypeProxyAttributeCache:ILAttribute option}
16871694

16881695
/// Build the table of commonly used references given a ILScopeRef for mscorlib.
1689-
valmkILGlobals:ILScopeRef->string option->ILGlobals
1696+
valmkILGlobals:ILScopeRef->string option->bool->ILGlobals
16901697

16911698

16921699
/// When writing a binary the fake "toplevel" type definition (called <Module>)
@@ -2109,8 +2116,6 @@ val mkDebuggerHiddenAttribute : ILGlobals -> ILAttribute
21092116
val mkDebuggerDisplayAttribute: ILGlobals-> string-> ILAttribute
21102117
val mkDebuggerTypeProxyAttribute: ILGlobals-> ILType-> ILAttribute
21112118
val mkDebuggerBrowsableNeverAttribute: ILGlobals-> ILAttribute
2112-
val mkDebuggerBrowsableRootHiddenAttribute: ILGlobals-> ILAttribute
2113-
val mkDebuggerBrowsableCollapsedAttribute: ILGlobals-> ILAttribute
21142119

21152120
val addMethodGeneratedAttrs: ILGlobals-> ILMethodDef-> ILMethodDef
21162121
val addPropertyGeneratedAttrs: ILGlobals-> ILPropertyDef-> ILPropertyDef

‎src/absil/ilascii.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//----------------------------------------------------------------------------
22
//
3-
// Copyright (c) 2002-2010 Microsoft Corporation.
3+
// Copyright (c) 2002-2011 Microsoft Corporation.
44
//
55
// This source code is subject to terms and conditions of the Apache License, Version 2.0. A
66
// copy of the license can be found in the License.html file at the root of this distribution.

‎src/absil/ilascii.fsi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//----------------------------------------------------------------------------
22
//
3-
// Copyright (c) 2002-2010 Microsoft Corporation.
3+
// Copyright (c) 2002-2011 Microsoft Corporation.
44
//
55
// This source code is subject to terms and conditions of the Apache License, Version 2.0. A
66
// copy of the license can be found in the License.html file at the root of this distribution.

‎src/absil/ilbinary.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//----------------------------------------------------------------------------
22
//
3-
// Copyright (c) 2002-2010 Microsoft Corporation.
3+
// Copyright (c) 2002-2011 Microsoft Corporation.
44
//
55
// This source code is subject to terms and conditions of the Apache License, Version 2.0. A
66
// copy of the license can be found in the License.html file at the root of this distribution.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp