Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
4b9f397e
F
fsharp
项目概览
dotNET Platform
/
fsharp
11 个月 前同步成功
通知
0
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
fsharp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4b9f397e
编写于
10月 01, 2015
作者:
D
Don Syme
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cleaup whitespace and types
上级
98eec39f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
38 addition
and
37 deletion
+38
-37
src/absil/il.fs
src/absil/il.fs
+9
-9
src/absil/il.fsi
src/absil/il.fsi
+21
-20
src/absil/ilwrite.fs
src/absil/ilwrite.fs
+8
-8
未找到文件。
src/absil/il.fs
浏览文件 @
4b9f397e
...
@@ -3263,8 +3263,8 @@ let cdef_cctorCode2CodeOrCreate tag f cd =
...
@@ -3263,8 +3263,8 @@ let cdef_cctorCode2CodeOrCreate tag f cd =
let
mdefs
=
cd
.
Methods
let
mdefs
=
cd
.
Methods
let
cctor
=
let
cctor
=
match
mdefs
.
FindByName
".cctor"
with
match
mdefs
.
FindByName
".cctor"
with
|
[
mdef
]
->
mdef
|
[
mdef
]
->
mdef
|
[
]
->
mkILClassCtor
(
mkMethodBody
(
false
,
emptyILLocals
,
1
,
nonBranchingInstrsToCode
[
],
tag
))
|
[]
->
mkILClassCtor
(
mkMethodBody
(
false
,
emptyILLocals
,
1
,
nonBranchingInstrsToCode
[
],
tag
))
|
_
->
failwith
"bad method table: more than one .cctor found"
|
_
->
failwith
"bad method table: more than one .cctor found"
let
methods
=
ILMethodDefs
(
fun
()
->
[|
yield
f
cctor
;
for
md
in
mdefs
do
if
md
.
Name
<>
".cctor"
then
yield
md
|])
let
methods
=
ILMethodDefs
(
fun
()
->
[|
yield
f
cctor
;
for
md
in
mdefs
do
if
md
.
Name
<>
".cctor"
then
yield
md
|])
...
@@ -3458,10 +3458,10 @@ let mkILSimpleClass ilg (nm, access, methods, fields, nestedTypes, props, events
...
@@ -3458,10 +3458,10 @@ let mkILSimpleClass ilg (nm, access, methods, fields, nestedTypes, props, events
let
mkILTypeDefForGlobalFunctions
ilg
(
methods
,
fields
)
=
mkILSimpleClass
ilg
(
typeNameForGlobalFunctions
,
ILTypeDefAccess
.
Public
,
methods
,
fields
,
emptyILTypeDefs
,
emptyILProperties
,
emptyILEvents
,
emptyILCustomAttrs
,
ILTypeInit
.
BeforeField
)
let
mkILTypeDefForGlobalFunctions
ilg
(
methods
,
fields
)
=
mkILSimpleClass
ilg
(
typeNameForGlobalFunctions
,
ILTypeDefAccess
.
Public
,
methods
,
fields
,
emptyILTypeDefs
,
emptyILProperties
,
emptyILEvents
,
emptyILCustomAttrs
,
ILTypeInit
.
BeforeField
)
let
destTypeDefsWithGlobalFunctionsFirst
ilg
(
tdefs
:
ILTypeDefs
)
=
let
destTypeDefsWithGlobalFunctionsFirst
ilg
(
tdefs
:
ILTypeDefs
)
=
let
l
=
tdefs
.
As
Array
let
l
=
tdefs
.
As
List
let
top
,
nontop
=
l
|>
Array
.
partition
(
fun
td
->
td
.
Name
=
typeNameForGlobalFunctions
)
let
top
,
nontop
=
l
|>
List
.
partition
(
fun
td
->
td
.
Name
=
typeNameForGlobalFunctions
)
let
top2
=
if
top
.
Length
=
0
then
[
|
mkILTypeDefForGlobalFunctions
ilg
(
emptyILMethods
,
emptyILFields
)
|
]
else
top
let
top2
=
if
top
.
Length
=
0
then
[
mkILTypeDefForGlobalFunctions
ilg
(
emptyILMethods
,
emptyILFields
)
]
else
top
Array
.
append
top2
nontop
top2
@
nontop
let
mkILSimpleModule
assname
modname
dll
subsystemVersion
useHighEntropyVA
tdefs
hashalg
locale
flags
exportedTypes
metadataVersion
=
let
mkILSimpleModule
assname
modname
dll
subsystemVersion
useHighEntropyVA
tdefs
hashalg
locale
flags
exportedTypes
metadataVersion
=
{
Manifest
=
{
Manifest
=
...
@@ -5101,8 +5101,8 @@ let resolveILMethodRef td (mref:ILMethodRef) =
...
@@ -5101,8 +5101,8 @@ let resolveILMethodRef td (mref:ILMethodRef) =
(
md
.
Parameters
,
mref
.
ArgTypes
)
||>
ILList
.
lengthsEqAndForall2
(
fun
p1
p2
->
p1
.
Type
=
p2
)
&&
(
md
.
Parameters
,
mref
.
ArgTypes
)
||>
ILList
.
lengthsEqAndForall2
(
fun
p1
p2
->
p1
.
Type
=
p2
)
&&
// REVIEW: this uses equality on ILType. For CMOD_OPTIONAL this is not going to be correct
// REVIEW: this uses equality on ILType. For CMOD_OPTIONAL this is not going to be correct
md
.
Return
.
Type
=
mref
.
ReturnType
)
with
md
.
Return
.
Type
=
mref
.
ReturnType
)
with
|
[
]
->
failwith
(
"no method named "
+
nm
+
" with appropriate argument types found in type "
+
td
.
Name
);
|
[]
->
failwith
(
"no method named "
+
nm
+
" with appropriate argument types found in type "
+
td
.
Name
);
|
[
mdef
]
->
mdef
|
[
mdef
]
->
mdef
|
_
->
failwith
(
"multiple methods named "
+
nm
+
" appear with identical argument types in type "
+
td
.
Name
)
|
_
->
failwith
(
"multiple methods named "
+
nm
+
" appear with identical argument types in type "
+
td
.
Name
)
let
mkRefToILModule
m
=
let
mkRefToILModule
m
=
...
@@ -5135,4 +5135,4 @@ type ILPropertyRef =
...
@@ -5135,4 +5135,4 @@ type ILPropertyRef =
{
prA
:
ILTypeRef
;
prB
:
string
}
{
prA
:
ILTypeRef
;
prB
:
string
}
static
member
Create
(
a
,
b
)
=
{
prA
=
a
;
prB
=
b
}
static
member
Create
(
a
,
b
)
=
{
prA
=
a
;
prB
=
b
}
member
x
.
EnclosingTypeRef
=
x
.
prA
member
x
.
EnclosingTypeRef
=
x
.
prA
member
x
.
Name
=
x
.
prB
member
x
.
Name
=
x
.
prB
\ No newline at end of file
src/absil/il.fsi
浏览文件 @
4b9f397e
...
@@ -1421,7 +1421,7 @@ type ILTypeDefs =
...
@@ -1421,7 +1421,7 @@ type ILTypeDefs =
member
AsList
:
ILTypeDef
list
member
AsList
:
ILTypeDef
list
/// Get some information about the type defs, but do not force the read of the type defs themselves
/// Get some information about the type defs, but do not force the read of the type defs themselves
member
AsArrayOfLazyTypeDefs
:
(
string
list
*
string
*
ILAttributes
*
Lazy
<
ILTypeDef
>)
[]
member
AsArrayOfLazyTypeDefs
:
(
string
list
*
string
*
ILAttributes
*
Lazy
<
ILTypeDef
>)
array
/// Calls to [FindByName] will result in any laziness in the overall
/// Calls to [FindByName] will result in any laziness in the overall
/// set of ILTypeDefs being read in in addition
/// set of ILTypeDefs being read in in addition
...
@@ -1794,7 +1794,7 @@ val EcmaILGlobals : ILGlobals
...
@@ -1794,7 +1794,7 @@ val EcmaILGlobals : ILGlobals
/// When writing a binary the fake "toplevel" type definition (called <Module>)
/// When writing a binary the fake "toplevel" type definition (called <Module>)
/// must come first. This function puts it first, and creates it in the returned list as an empty typedef if it
/// must come first. This function puts it first, and creates it in the returned list as an empty typedef if it
/// doesn't already exist.
/// doesn't already exist.
val
destTypeDefsWithGlobalFunctionsFirst
:
ILGlobals
->
ILTypeDefs
->
ILTypeDef
[]
val
destTypeDefsWithGlobalFunctionsFirst
:
ILGlobals
->
ILTypeDefs
->
ILTypeDef
list
/// Note: not all custom attribute data can be decoded without binding types. In particular
/// Note: not all custom attribute data can be decoded without binding types. In particular
/// enums must be bound in order to discover the size of the underlying integer.
/// enums must be bound in order to discover the size of the underlying integer.
...
@@ -2069,7 +2069,7 @@ val emptyILTypeDefs: ILTypeDefs
...
@@ -2069,7 +2069,7 @@ val emptyILTypeDefs: ILTypeDefs
///
///
/// Note that individual type definitions may contain further delays
/// Note that individual type definitions may contain further delays
/// in their method, field and other tables.
/// in their method, field and other tables.
val
mkILTypeDefsComputed
:
(
unit
->
(
string
list
*
string
*
ILAttributes
*
Lazy
<
ILTypeDef
>)
[]
)
->
ILTypeDefs
val
mkILTypeDefsComputed
:
(
unit
->
(
string
list
*
string
*
ILAttributes
*
Lazy
<
ILTypeDef
>)
array
)
->
ILTypeDefs
val
addILTypeDef
:
ILTypeDef
->
ILTypeDefs
->
ILTypeDefs
val
addILTypeDef
:
ILTypeDef
->
ILTypeDefs
->
ILTypeDefs
val
mkILNestedExportedTypes
:
ILNestedExportedType
list
->
ILNestedExportedTypes
val
mkILNestedExportedTypes
:
ILNestedExportedType
list
->
ILNestedExportedTypes
...
@@ -2255,22 +2255,6 @@ val getTyOfILEnumInfo: ILEnumInfo -> ILType
...
@@ -2255,22 +2255,6 @@ val getTyOfILEnumInfo: ILEnumInfo -> ILType
val
computeILEnumInfo
:
string
*
ILFieldDefs
->
ILEnumInfo
val
computeILEnumInfo
:
string
*
ILFieldDefs
->
ILEnumInfo
val
runningOnMono
:
bool
type
ILReferences
=
{
AssemblyReferences
:
ILAssemblyRef
list
;
ModuleReferences
:
ILModuleRef
list
;
}
/// Find the full set of assemblies referenced by a module
val
computeILRefs
:
ILModuleDef
->
ILReferences
val
emptyILRefs
:
ILReferences
// --------------------------------------------------------------------
// The following functions are used to define an extension to the In reality the only extension is ILX
type
ILTypeDefKindExtension
<
'
Extension
>
=
TypeDefKindExtension
val
RegisterTypeDefKindExtension
:
ILTypeDefKindExtension
<
'
Extension
>
->
(
'
Extension
->
IlxExtensionTypeKind
)
*
(
IlxExtensionTypeKind
->
bool
)
*
(
IlxExtensionTypeKind
->
'
Extension
)
// --------------------------------------------------------------------
// --------------------------------------------------------------------
// For completeness. These do not occur in metadata but tools that
// For completeness. These do not occur in metadata but tools that
...
@@ -2289,4 +2273,21 @@ type ILPropertyRef =
...
@@ -2289,4 +2273,21 @@ type ILPropertyRef =
static
member
Create
:
ILTypeRef
*
string
->
ILPropertyRef
static
member
Create
:
ILTypeRef
*
string
->
ILPropertyRef
member
EnclosingTypeRef
:
ILTypeRef
member
EnclosingTypeRef
:
ILTypeRef
member
Name
:
string
member
Name
:
string
interface
System
.
IComparable
interface
System
.
IComparable
\ No newline at end of file
val
runningOnMono
:
bool
type
ILReferences
=
{
AssemblyReferences
:
ILAssemblyRef
list
;
ModuleReferences
:
ILModuleRef
list
;
}
/// Find the full set of assemblies referenced by a module
val
computeILRefs
:
ILModuleDef
->
ILReferences
val
emptyILRefs
:
ILReferences
// --------------------------------------------------------------------
// The following functions are used to define an extension to the In reality the only extension is ILX
type
ILTypeDefKindExtension
<
'
Extension
>
=
TypeDefKindExtension
val
RegisterTypeDefKindExtension
:
ILTypeDefKindExtension
<
'
Extension
>
->
(
'
Extension
->
IlxExtensionTypeKind
)
*
(
IlxExtensionTypeKind
->
bool
)
*
(
IlxExtensionTypeKind
->
'
Extension
)
src/absil/ilwrite.fs
浏览文件 @
4b9f397e
...
@@ -1008,9 +1008,9 @@ let GetTypeNameAsElemPair cenv n =
...
@@ -1008,9 +1008,9 @@ let GetTypeNameAsElemPair cenv n =
let
rec
GenTypeDefPass1
enc
cenv
(
td
:
ILTypeDef
)
=
let
rec
GenTypeDefPass1
enc
cenv
(
td
:
ILTypeDef
)
=
ignore
(
cenv
.
typeDefs
.
AddUniqueEntry
"type index"
(
fun
(
TdKey
(_,
n
))
->
n
)
(
TdKey
(
enc
,
td
.
Name
)))
ignore
(
cenv
.
typeDefs
.
AddUniqueEntry
"type index"
(
fun
(
TdKey
(_,
n
))
->
n
)
(
TdKey
(
enc
,
td
.
Name
)))
GenTypeDefsPass1
(
enc
@[
td
.
Name
])
cenv
td
.
NestedTypes
.
As
Array
GenTypeDefsPass1
(
enc
@[
td
.
Name
])
cenv
td
.
NestedTypes
.
As
List
and
GenTypeDefsPass1
enc
cenv
tds
=
Array
.
iter
(
GenTypeDefPass1
enc
cenv
)
tds
and
GenTypeDefsPass1
enc
cenv
tds
=
List
.
iter
(
GenTypeDefPass1
enc
cenv
)
tds
//=====================================================================
//=====================================================================
// Pass 2 - allocate indexes for methods and fields and write rows for types
// Pass 2 - allocate indexes for methods and fields and write rows for types
...
@@ -1545,12 +1545,12 @@ and GenTypeDefPass2 pidx enc cenv (td:ILTypeDef) =
...
@@ -1545,12 +1545,12 @@ and GenTypeDefPass2 pidx enc cenv (td:ILTypeDef) =
events
|>
List
.
iter
(
GenEventDefPass2
cenv
tidx
)
events
|>
List
.
iter
(
GenEventDefPass2
cenv
tidx
)
td
.
Fields
.
AsList
|>
List
.
iter
(
GenFieldDefPass2
cenv
tidx
)
td
.
Fields
.
AsList
|>
List
.
iter
(
GenFieldDefPass2
cenv
tidx
)
td
.
Methods
|>
Seq
.
iter
(
GenMethodDefPass2
cenv
tidx
)
td
.
Methods
|>
Seq
.
iter
(
GenMethodDefPass2
cenv
tidx
)
td
.
NestedTypes
.
As
Array
|>
GenTypeDefsPass2
tidx
(
enc
@[
td
.
Name
])
cenv
td
.
NestedTypes
.
As
List
|>
GenTypeDefsPass2
tidx
(
enc
@[
td
.
Name
])
cenv
with
e
->
with
e
->
failwith
(
"Error in pass2 for type "
+
td
.
Name
+
", error: "
+
e
.
Message
)
failwith
(
"Error in pass2 for type "
+
td
.
Name
+
", error: "
+
e
.
Message
)
and
GenTypeDefsPass2
pidx
enc
cenv
tds
=
and
GenTypeDefsPass2
pidx
enc
cenv
tds
=
Array
.
iter
(
GenTypeDefPass2
pidx
enc
cenv
)
tds
List
.
iter
(
GenTypeDefPass2
pidx
enc
cenv
)
tds
//=====================================================================
//=====================================================================
// Pass 3 - write details of methods, fields, IL code, custom attrs etc.
// Pass 3 - write details of methods, fields, IL code, custom attrs etc.
...
@@ -3141,14 +3141,14 @@ let rec GenTypeDefPass3 enc cenv (td:ILTypeDef) =
...
@@ -3141,14 +3141,14 @@ let rec GenTypeDefPass3 enc cenv (td:ILTypeDef) =
td
.
SecurityDecls
.
AsList
|>
GenSecurityDeclsPass3
cenv
(
hds_TypeDef
,
tidx
)
td
.
SecurityDecls
.
AsList
|>
GenSecurityDeclsPass3
cenv
(
hds_TypeDef
,
tidx
)
td
.
CustomAttrs
|>
GenCustomAttrsPass3Or4
cenv
(
hca_TypeDef
,
tidx
)
td
.
CustomAttrs
|>
GenCustomAttrsPass3Or4
cenv
(
hca_TypeDef
,
tidx
)
td
.
GenericParams
|>
List
.
iteri
(
fun
n
gp
->
GenGenericParamPass3
cenv
env
n
(
tomd_TypeDef
,
tidx
)
gp
)
td
.
GenericParams
|>
List
.
iteri
(
fun
n
gp
->
GenGenericParamPass3
cenv
env
n
(
tomd_TypeDef
,
tidx
)
gp
)
td
.
NestedTypes
.
As
Array
|>
GenTypeDefsPass3
(
enc
@[
td
.
Name
])
cenv
td
.
NestedTypes
.
As
List
|>
GenTypeDefsPass3
(
enc
@[
td
.
Name
])
cenv
with
e
->
with
e
->
failwith
(
"Error in pass3 for type "
+
td
.
Name
+
", error: "
+
e
.
Message
)
failwith
(
"Error in pass3 for type "
+
td
.
Name
+
", error: "
+
e
.
Message
)
reraise
()
reraise
()
raise
e
raise
e
and
GenTypeDefsPass3
enc
cenv
tds
=
and
GenTypeDefsPass3
enc
cenv
tds
=
Array
.
iter
(
GenTypeDefPass3
enc
cenv
)
tds
List
.
iter
(
GenTypeDefPass3
enc
cenv
)
tds
/// ILTypeDef --> generate generic params on ILMethodDef: ensures
/// ILTypeDef --> generate generic params on ILMethodDef: ensures
/// GenericParam table is built sorted by owner.
/// GenericParam table is built sorted by owner.
...
@@ -3159,14 +3159,14 @@ let rec GenTypeDefPass4 enc cenv (td:ILTypeDef) =
...
@@ -3159,14 +3159,14 @@ let rec GenTypeDefPass4 enc cenv (td:ILTypeDef) =
let
tidx
=
GetIdxForTypeDef
cenv
(
TdKey
(
enc
,
td
.
Name
))
let
tidx
=
GetIdxForTypeDef
cenv
(
TdKey
(
enc
,
td
.
Name
))
td
.
Methods
|>
Seq
.
iter
(
GenMethodDefPass4
cenv
env
)
td
.
Methods
|>
Seq
.
iter
(
GenMethodDefPass4
cenv
env
)
List
.
iteri
(
fun
n
gp
->
GenGenericParamPass4
cenv
env
n
(
tomd_TypeDef
,
tidx
)
gp
)
td
.
GenericParams
List
.
iteri
(
fun
n
gp
->
GenGenericParamPass4
cenv
env
n
(
tomd_TypeDef
,
tidx
)
gp
)
td
.
GenericParams
GenTypeDefsPass4
(
enc
@[
td
.
Name
])
cenv
td
.
NestedTypes
.
As
Array
GenTypeDefsPass4
(
enc
@[
td
.
Name
])
cenv
td
.
NestedTypes
.
As
List
with
e
->
with
e
->
failwith
(
"Error in pass4 for type "
+
td
.
Name
+
", error: "
+
e
.
Message
)
failwith
(
"Error in pass4 for type "
+
td
.
Name
+
", error: "
+
e
.
Message
)
reraise
()
reraise
()
raise
e
raise
e
and
GenTypeDefsPass4
enc
cenv
tds
=
and
GenTypeDefsPass4
enc
cenv
tds
=
Array
.
iter
(
GenTypeDefPass4
enc
cenv
)
tds
List
.
iter
(
GenTypeDefPass4
enc
cenv
)
tds
// --------------------------------------------------------------------
// --------------------------------------------------------------------
// ILExportedTypesAndForwarders --> ILExportedTypeOrForwarder table
// ILExportedTypesAndForwarders --> ILExportedTypeOrForwarder table
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录