Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
a827fee8
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a827fee8
编写于
4月 15, 2015
作者:
C
Charles Stoner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use PEModuleBuilder.IgnoreAccessibility
上级
fbad195c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
12 addition
and
22 deletion
+12
-22
src/Compilers/CSharp/Portable/Compiler/MethodCompiler.cs
src/Compilers/CSharp/Portable/Compiler/MethodCompiler.cs
+1
-2
src/Compilers/CSharp/Portable/Lowering/LambdaRewriter/ExpressionLambdaRewriter.cs
...table/Lowering/LambdaRewriter/ExpressionLambdaRewriter.cs
+6
-6
src/Compilers/CSharp/Portable/Lowering/LambdaRewriter/LambdaRewriter.cs
...CSharp/Portable/Lowering/LambdaRewriter/LambdaRewriter.cs
+4
-12
src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/Symbols/EEMethodSymbol.cs
...Sharp/Source/ExpressionCompiler/Symbols/EEMethodSymbol.cs
+1
-2
未找到文件。
src/Compilers/CSharp/Portable/Compiler/MethodCompiler.cs
浏览文件 @
a827fee8
...
@@ -1201,8 +1201,7 @@ private BoundStatement ChainImplicitStructConstructor(MethodSymbol methodSymbol,
...
@@ -1201,8 +1201,7 @@ private BoundStatement ChainImplicitStructConstructor(MethodSymbol methodSymbol,
lazyVariableSlotAllocator
,
lazyVariableSlotAllocator
,
compilationState
,
compilationState
,
diagnostics
,
diagnostics
,
assignLocals
:
false
,
assignLocals
:
false
);
allowNonPublicTypeArguments
:
false
);
}
}
if
(
bodyWithoutLambdas
.
HasErrors
)
if
(
bodyWithoutLambdas
.
HasErrors
)
...
...
src/Compilers/CSharp/Portable/Lowering/LambdaRewriter/ExpressionLambdaRewriter.cs
浏览文件 @
a827fee8
...
@@ -14,7 +14,7 @@ internal class ExpressionLambdaRewriter // this is like a bound tree rewriter, b
...
@@ -14,7 +14,7 @@ internal class ExpressionLambdaRewriter // this is like a bound tree rewriter, b
private
readonly
SyntheticBoundNodeFactory
_bound
;
private
readonly
SyntheticBoundNodeFactory
_bound
;
private
readonly
TypeMap
_typeMap
;
private
readonly
TypeMap
_typeMap
;
private
readonly
Dictionary
<
ParameterSymbol
,
BoundExpression
>
_parameterMap
=
new
Dictionary
<
ParameterSymbol
,
BoundExpression
>();
private
readonly
Dictionary
<
ParameterSymbol
,
BoundExpression
>
_parameterMap
=
new
Dictionary
<
ParameterSymbol
,
BoundExpression
>();
private
readonly
bool
_
allowNonPublicTypeArguments
;
private
readonly
bool
_
ignoreAccessibility
;
private
NamedTypeSymbol
_ExpressionType
;
private
NamedTypeSymbol
_ExpressionType
;
private
NamedTypeSymbol
ExpressionType
private
NamedTypeSymbol
ExpressionType
...
@@ -92,10 +92,10 @@ private NamedTypeSymbol MemberInfoType
...
@@ -92,10 +92,10 @@ private NamedTypeSymbol MemberInfoType
private
DiagnosticBag
Diagnostics
{
get
{
return
_bound
.
Diagnostics
;
}
}
private
DiagnosticBag
Diagnostics
{
get
{
return
_bound
.
Diagnostics
;
}
}
private
ExpressionLambdaRewriter
(
TypeCompilationState
compilationState
,
TypeMap
typeMap
,
bool
allowNonPublicTypeArguments
,
CSharpSyntaxNode
node
,
DiagnosticBag
diagnostics
)
private
ExpressionLambdaRewriter
(
TypeCompilationState
compilationState
,
TypeMap
typeMap
,
CSharpSyntaxNode
node
,
DiagnosticBag
diagnostics
)
{
{
_bound
=
new
SyntheticBoundNodeFactory
(
null
,
compilationState
.
Type
,
node
,
compilationState
,
diagnostics
);
_bound
=
new
SyntheticBoundNodeFactory
(
null
,
compilationState
.
Type
,
node
,
compilationState
,
diagnostics
);
_
allowNonPublicTypeArguments
=
allowNonPublicTypeArguments
;
_
ignoreAccessibility
=
compilationState
.
ModuleBuilderOpt
.
IgnoreAccessibility
;
_int32Type
=
_bound
.
SpecialType
(
SpecialType
.
System_Int32
);
_int32Type
=
_bound
.
SpecialType
(
SpecialType
.
System_Int32
);
_objectType
=
_bound
.
SpecialType
(
SpecialType
.
System_Object
);
_objectType
=
_bound
.
SpecialType
(
SpecialType
.
System_Object
);
_nullableType
=
_bound
.
SpecialType
(
SpecialType
.
System_Nullable_T
);
_nullableType
=
_bound
.
SpecialType
(
SpecialType
.
System_Nullable_T
);
...
@@ -104,11 +104,11 @@ private ExpressionLambdaRewriter(TypeCompilationState compilationState, TypeMap
...
@@ -104,11 +104,11 @@ private ExpressionLambdaRewriter(TypeCompilationState compilationState, TypeMap
_typeMap
=
typeMap
;
_typeMap
=
typeMap
;
}
}
internal
static
BoundNode
RewriteLambda
(
BoundLambda
node
,
TypeCompilationState
compilationState
,
TypeMap
typeMap
,
bool
allowNonPublicTypeArguments
,
DiagnosticBag
diagnostics
)
internal
static
BoundNode
RewriteLambda
(
BoundLambda
node
,
TypeCompilationState
compilationState
,
TypeMap
typeMap
,
DiagnosticBag
diagnostics
)
{
{
try
try
{
{
var
r
=
new
ExpressionLambdaRewriter
(
compilationState
,
typeMap
,
allowNonPublicTypeArguments
,
node
.
Syntax
,
diagnostics
);
var
r
=
new
ExpressionLambdaRewriter
(
compilationState
,
typeMap
,
node
.
Syntax
,
diagnostics
);
var
result
=
r
.
VisitLambdaInternal
(
node
);
var
result
=
r
.
VisitLambdaInternal
(
node
);
if
(
node
.
Type
!=
result
.
Type
)
if
(
node
.
Type
!=
result
.
Type
)
{
{
...
@@ -972,7 +972,7 @@ private BoundExpression ExprFactory(string name, params BoundExpression[] argume
...
@@ -972,7 +972,7 @@ private BoundExpression ExprFactory(string name, params BoundExpression[] argume
private
BoundExpression
ExprFactory
(
string
name
,
ImmutableArray
<
TypeSymbol
>
typeArgs
,
params
BoundExpression
[]
arguments
)
private
BoundExpression
ExprFactory
(
string
name
,
ImmutableArray
<
TypeSymbol
>
typeArgs
,
params
BoundExpression
[]
arguments
)
{
{
return
_bound
.
StaticCall
(
_
allowNonPublicTypeArguments
?
BinderFlags
.
IgnoreAccessibility
:
BinderFlags
.
None
,
ExpressionType
,
name
,
typeArgs
,
arguments
);
return
_bound
.
StaticCall
(
_
ignoreAccessibility
?
BinderFlags
.
IgnoreAccessibility
:
BinderFlags
.
None
,
ExpressionType
,
name
,
typeArgs
,
arguments
);
}
}
private
BoundExpression
ExprFactory
(
WellKnownMember
method
,
ImmutableArray
<
TypeSymbol
>
typeArgs
,
params
BoundExpression
[]
arguments
)
private
BoundExpression
ExprFactory
(
WellKnownMember
method
,
ImmutableArray
<
TypeSymbol
>
typeArgs
,
params
BoundExpression
[]
arguments
)
...
...
src/Compilers/CSharp/Portable/Lowering/LambdaRewriter/LambdaRewriter.cs
浏览文件 @
a827fee8
...
@@ -79,9 +79,6 @@ internal sealed partial class LambdaRewriter : MethodToClassRewriter
...
@@ -79,9 +79,6 @@ internal sealed partial class LambdaRewriter : MethodToClassRewriter
// expression evaluator where the original locals are left as is.
// expression evaluator where the original locals are left as is.
private
readonly
bool
_assignLocals
;
private
readonly
bool
_assignLocals
;
// Allow type arguments of constructed methods to be non-public.
private
readonly
bool
_allowNonPublicTypeArguments
;
// The current method or lambda being processed.
// The current method or lambda being processed.
private
MethodSymbol
_currentMethod
;
private
MethodSymbol
_currentMethod
;
...
@@ -131,8 +128,7 @@ internal sealed partial class LambdaRewriter : MethodToClassRewriter
...
@@ -131,8 +128,7 @@ internal sealed partial class LambdaRewriter : MethodToClassRewriter
VariableSlotAllocator
slotAllocatorOpt
,
VariableSlotAllocator
slotAllocatorOpt
,
TypeCompilationState
compilationState
,
TypeCompilationState
compilationState
,
DiagnosticBag
diagnostics
,
DiagnosticBag
diagnostics
,
bool
assignLocals
,
bool
assignLocals
)
bool
allowNonPublicTypeArguments
)
:
base
(
slotAllocatorOpt
,
compilationState
,
diagnostics
)
:
base
(
slotAllocatorOpt
,
compilationState
,
diagnostics
)
{
{
Debug
.
Assert
(
analysis
!=
null
);
Debug
.
Assert
(
analysis
!=
null
);
...
@@ -147,7 +143,6 @@ internal sealed partial class LambdaRewriter : MethodToClassRewriter
...
@@ -147,7 +143,6 @@ internal sealed partial class LambdaRewriter : MethodToClassRewriter
_currentMethod
=
method
;
_currentMethod
=
method
;
_analysis
=
analysis
;
_analysis
=
analysis
;
_assignLocals
=
assignLocals
;
_assignLocals
=
assignLocals
;
_allowNonPublicTypeArguments
=
allowNonPublicTypeArguments
;
_currentTypeParameters
=
method
.
TypeParameters
;
_currentTypeParameters
=
method
.
TypeParameters
;
_currentLambdaBodyTypeMap
=
TypeMap
.
Empty
;
_currentLambdaBodyTypeMap
=
TypeMap
.
Empty
;
_innermostFramePointer
=
_currentFrameThis
=
thisParameterOpt
;
_innermostFramePointer
=
_currentFrameThis
=
thisParameterOpt
;
...
@@ -179,7 +174,6 @@ protected override bool NeedsProxy(Symbol localOrParameter)
...
@@ -179,7 +174,6 @@ protected override bool NeedsProxy(Symbol localOrParameter)
/// <param name="compilationState">The caller's buffer into which we produce additional methods to be emitted by the caller</param>
/// <param name="compilationState">The caller's buffer into which we produce additional methods to be emitted by the caller</param>
/// <param name="diagnostics">Diagnostic bag for diagnostics</param>
/// <param name="diagnostics">Diagnostic bag for diagnostics</param>
/// <param name="assignLocals">The rewritten tree should include assignments of the original locals to the lifted proxies</param>
/// <param name="assignLocals">The rewritten tree should include assignments of the original locals to the lifted proxies</param>
/// <param name="allowNonPublicTypeArguments">Allow type arguments of constructed methods to be non-public</param>
public
static
BoundStatement
Rewrite
(
public
static
BoundStatement
Rewrite
(
BoundStatement
loweredBody
,
BoundStatement
loweredBody
,
NamedTypeSymbol
thisType
,
NamedTypeSymbol
thisType
,
...
@@ -191,8 +185,7 @@ protected override bool NeedsProxy(Symbol localOrParameter)
...
@@ -191,8 +185,7 @@ protected override bool NeedsProxy(Symbol localOrParameter)
VariableSlotAllocator
slotAllocatorOpt
,
VariableSlotAllocator
slotAllocatorOpt
,
TypeCompilationState
compilationState
,
TypeCompilationState
compilationState
,
DiagnosticBag
diagnostics
,
DiagnosticBag
diagnostics
,
bool
assignLocals
,
bool
assignLocals
)
bool
allowNonPublicTypeArguments
)
{
{
Debug
.
Assert
((
object
)
thisType
!=
null
);
Debug
.
Assert
((
object
)
thisType
!=
null
);
Debug
.
Assert
(((
object
)
thisParameter
==
null
)
||
(
thisParameter
.
Type
==
thisType
));
Debug
.
Assert
(((
object
)
thisParameter
==
null
)
||
(
thisParameter
.
Type
==
thisType
));
...
@@ -220,8 +213,7 @@ protected override bool NeedsProxy(Symbol localOrParameter)
...
@@ -220,8 +213,7 @@ protected override bool NeedsProxy(Symbol localOrParameter)
slotAllocatorOpt
,
slotAllocatorOpt
,
compilationState
,
compilationState
,
diagnostics
,
diagnostics
,
assignLocals
,
assignLocals
);
allowNonPublicTypeArguments
);
analysis
.
ComputeLambdaScopesAndFrameCaptures
();
analysis
.
ComputeLambdaScopesAndFrameCaptures
();
rewriter
.
MakeFrames
(
closureDebugInfoBuilder
);
rewriter
.
MakeFrames
(
closureDebugInfoBuilder
);
...
@@ -999,7 +991,7 @@ private BoundNode RewriteLambdaConversion(BoundLambda node)
...
@@ -999,7 +991,7 @@ private BoundNode RewriteLambdaConversion(BoundLambda node)
var
newType
=
VisitType
(
node
.
Type
);
var
newType
=
VisitType
(
node
.
Type
);
var
newBody
=
(
BoundBlock
)
Visit
(
node
.
Body
);
var
newBody
=
(
BoundBlock
)
Visit
(
node
.
Body
);
node
=
node
.
Update
(
node
.
Symbol
,
newBody
,
node
.
Diagnostics
,
node
.
Binder
,
newType
);
node
=
node
.
Update
(
node
.
Symbol
,
newBody
,
node
.
Diagnostics
,
node
.
Binder
,
newType
);
var
result0
=
wasInExpressionLambda
?
node
:
ExpressionLambdaRewriter
.
RewriteLambda
(
node
,
CompilationState
,
TypeMap
,
_allowNonPublicTypeArguments
,
Diagnostics
);
var
result0
=
wasInExpressionLambda
?
node
:
ExpressionLambdaRewriter
.
RewriteLambda
(
node
,
CompilationState
,
TypeMap
,
Diagnostics
);
_inExpressionLambda
=
wasInExpressionLambda
;
_inExpressionLambda
=
wasInExpressionLambda
;
return
result0
;
return
result0
;
}
}
...
...
src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/Symbols/EEMethodSymbol.cs
浏览文件 @
a827fee8
...
@@ -565,8 +565,7 @@ internal override void GenerateMethodBody(TypeCompilationState compilationState,
...
@@ -565,8 +565,7 @@ internal override void GenerateMethodBody(TypeCompilationState compilationState,
slotAllocatorOpt
:
null
,
slotAllocatorOpt
:
null
,
compilationState
:
compilationState
,
compilationState
:
compilationState
,
diagnostics
:
diagnostics
,
diagnostics
:
diagnostics
,
assignLocals
:
true
,
assignLocals
:
true
);
allowNonPublicTypeArguments
:
true
);
// we don't need this information:
// we don't need this information:
closureDebugInfoBuilder
.
Free
();
closureDebugInfoBuilder
.
Free
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录