Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
7064b04b
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,发现更多精彩内容 >>
未验证
提交
7064b04b
编写于
6月 19, 2018
作者:
F
Fredric Silberberg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Addressed PR feedback.
上级
963ad99c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
9 deletion
+10
-9
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ILockStatement.cs
...est/Semantic/IOperation/IOperationTests_ILockStatement.cs
+4
-4
src/Compilers/Core/Portable/Operations/ControlFlowGraphBuilder.cs
...ilers/Core/Portable/Operations/ControlFlowGraphBuilder.cs
+5
-4
src/Compilers/VisualBasic/Test/IOperation/IOperation/IOperationTests_ILockStatement.vb
...t/IOperation/IOperation/IOperationTests_ILockStatement.vb
+1
-1
未找到文件。
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ILockStatement.cs
浏览文件 @
7064b04b
...
@@ -449,7 +449,7 @@ void M(object source1, object source2, object source3)
...
@@ -449,7 +449,7 @@ void M(object source1, object source2, object source3)
InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: lockTaken) (OperationKind.Argument, Type: null, IsImplicit) (Syntax: 'source1 ?? source2')
IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: lockTaken) (OperationKind.Argument, Type: null, IsImplicit) (Syntax: 'source1 ?? source2')
ILocalReferenceOperation: (OperationKind.LocalReference, Type: System.Boolean, Constant: null, IsImplicit) (Syntax: 'source1 ?? source2')
ILocalReferenceOperation: (
IsDeclaration: True) (
OperationKind.LocalReference, Type: System.Boolean, Constant: null, IsImplicit) (Syntax: 'source1 ?? source2')
InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
...
@@ -652,7 +652,7 @@ void M(int input1, bool input2)
...
@@ -652,7 +652,7 @@ void M(int input1, bool input2)
InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: lockTaken) (OperationKind.Argument, Type: null, IsInvalid, IsImplicit) (Syntax: 'input1')
IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: lockTaken) (OperationKind.Argument, Type: null, IsInvalid, IsImplicit) (Syntax: 'input1')
ILocalReferenceOperation: (OperationKind.LocalReference, Type: System.Boolean, Constant: null, IsInvalid, IsImplicit) (Syntax: 'input1')
ILocalReferenceOperation: (
IsDeclaration: True) (
OperationKind.LocalReference, Type: System.Boolean, Constant: null, IsInvalid, IsImplicit) (Syntax: 'input1')
InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
...
@@ -759,7 +759,7 @@ void M(bool input2)
...
@@ -759,7 +759,7 @@ void M(bool input2)
InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: lockTaken) (OperationKind.Argument, Type: null, IsImplicit) (Syntax: 'null')
IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: lockTaken) (OperationKind.Argument, Type: null, IsImplicit) (Syntax: 'null')
ILocalReferenceOperation: (OperationKind.LocalReference, Type: System.Boolean, Constant: null, IsImplicit) (Syntax: 'null')
ILocalReferenceOperation: (
IsDeclaration: True) (
OperationKind.LocalReference, Type: System.Boolean, Constant: null, IsImplicit) (Syntax: 'null')
InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
...
@@ -948,7 +948,7 @@ void M(P input, bool b)
...
@@ -948,7 +948,7 @@ void M(P input, bool b)
InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: lockTaken) (OperationKind.Argument, Type: null, IsImplicit) (Syntax: 'input')
IArgumentOperation (ArgumentKind.Explicit, Matching Parameter: lockTaken) (OperationKind.Argument, Type: null, IsImplicit) (Syntax: 'input')
ILocalReferenceOperation: (OperationKind.LocalReference, Type: System.Boolean, Constant: null, IsImplicit) (Syntax: 'input')
ILocalReferenceOperation: (
IsDeclaration: True) (
OperationKind.LocalReference, Type: System.Boolean, Constant: null, IsImplicit) (Syntax: 'input')
InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
InConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
OutConversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
...
...
src/Compilers/Core/Portable/Operations/ControlFlowGraphBuilder.cs
浏览文件 @
7064b04b
...
@@ -3243,6 +3243,7 @@ public override IOperation VisitLock(ILockOperation operation, int? captureIdFor
...
@@ -3243,6 +3243,7 @@ public override IOperation VisitLock(ILockOperation operation, int? captureIdFor
// For simplicity, we will not synthesize this call because its presence is unlikely to affect graph analysis.
// For simplicity, we will not synthesize this call because its presence is unlikely to affect graph analysis.
IOperation
lockedValue
=
Visit
(
operation
.
LockedValue
);
IOperation
lockedValue
=
Visit
(
operation
.
LockedValue
);
var
baseLockStatement
=
(
BaseLockStatement
)
operation
;
if
(!
objectType
.
Equals
(
lockedValue
.
Type
))
if
(!
objectType
.
Equals
(
lockedValue
.
Type
))
{
{
...
@@ -3258,6 +3259,7 @@ public override IOperation VisitLock(ILockOperation operation, int? captureIdFor
...
@@ -3258,6 +3259,7 @@ public override IOperation VisitLock(ILockOperation operation, int? captureIdFor
if
(
legacyMode
)
if
(
legacyMode
)
{
{
Debug
.
Assert
(
baseLockStatement
.
LockTakenSymbol
==
null
);
enterMethod
=
(
IMethodSymbol
)
_compilation
.
CommonGetWellKnownTypeMember
(
WellKnownMember
.
System_Threading_Monitor__Enter
);
enterMethod
=
(
IMethodSymbol
)
_compilation
.
CommonGetWellKnownTypeMember
(
WellKnownMember
.
System_Threading_Monitor__Enter
);
// Monitor.Enter($lock);
// Monitor.Enter($lock);
...
@@ -3283,7 +3285,6 @@ public override IOperation VisitLock(ILockOperation operation, int? captureIdFor
...
@@ -3283,7 +3285,6 @@ public override IOperation VisitLock(ILockOperation operation, int? captureIdFor
}
}
else
else
{
{
var
baseLockStatement
=
(
BaseLockStatement
)
operation
;
EnterRegion
(
new
RegionBuilder
(
ControlFlowRegionKind
.
LocalLifetime
,
locals
:
ImmutableArray
.
Create
(
baseLockStatement
.
LockTakenSymbol
)));
EnterRegion
(
new
RegionBuilder
(
ControlFlowRegionKind
.
LocalLifetime
,
locals
:
ImmutableArray
.
Create
(
baseLockStatement
.
LockTakenSymbol
)));
}
}
...
@@ -3296,8 +3297,7 @@ public override IOperation VisitLock(ILockOperation operation, int? captureIdFor
...
@@ -3296,8 +3297,7 @@ public override IOperation VisitLock(ILockOperation operation, int? captureIdFor
if
(!
legacyMode
)
if
(!
legacyMode
)
{
{
// Monitor.Enter($lock, ref $lockTaken);
// Monitor.Enter($lock, ref $lockTaken);
var
baseLockStatement
=
(
BaseLockStatement
)
operation
;
lockTaken
=
new
LocalReferenceExpression
(
baseLockStatement
.
LockTakenSymbol
,
isDeclaration
:
true
,
semanticModel
:
null
,
lockedValue
.
Syntax
,
lockTaken
=
new
LocalReferenceExpression
(
baseLockStatement
.
LockTakenSymbol
,
isDeclaration
:
false
,
semanticModel
:
null
,
lockedValue
.
Syntax
,
baseLockStatement
.
LockTakenSymbol
.
Type
,
constantValue
:
null
,
isImplicit
:
true
);
baseLockStatement
.
LockTakenSymbol
.
Type
,
constantValue
:
null
,
isImplicit
:
true
);
AddStatement
(
new
InvocationExpression
(
enterMethod
,
instance
:
null
,
isVirtual
:
false
,
AddStatement
(
new
InvocationExpression
(
enterMethod
,
instance
:
null
,
isVirtual
:
false
,
ImmutableArray
.
Create
<
IArgumentOperation
>(
ImmutableArray
.
Create
<
IArgumentOperation
>(
...
@@ -3337,7 +3337,8 @@ public override IOperation VisitLock(ILockOperation operation, int? captureIdFor
...
@@ -3337,7 +3337,8 @@ public override IOperation VisitLock(ILockOperation operation, int? captureIdFor
if
(!
legacyMode
)
if
(!
legacyMode
)
{
{
// if ($lockTaken)
// if ($lockTaken)
IOperation
condition
=
OperationCloner
.
CloneOperation
(
lockTaken
);
IOperation
condition
=
new
LocalReferenceExpression
(
baseLockStatement
.
LockTakenSymbol
,
isDeclaration
:
false
,
semanticModel
:
null
,
lockedValue
.
Syntax
,
baseLockStatement
.
LockTakenSymbol
.
Type
,
constantValue
:
null
,
isImplicit
:
true
);
condition
=
Operation
.
SetParentOperation
(
condition
,
null
);
condition
=
Operation
.
SetParentOperation
(
condition
,
null
);
LinkBlocks
(
CurrentBasicBlock
,
condition
,
jumpIfTrue
:
false
,
RegularBranch
(
endOfFinally
));
LinkBlocks
(
CurrentBasicBlock
,
condition
,
jumpIfTrue
:
false
,
RegularBranch
(
endOfFinally
));
_currentBasicBlock
=
null
;
_currentBasicBlock
=
null
;
...
...
src/Compilers/VisualBasic/Test/IOperation/IOperation/IOperationTests_ILockStatement.vb
浏览文件 @
7064b04b
...
@@ -411,7 +411,7 @@ Block[B1] - Block
...
@@ -411,7 +411,7 @@ Block[B1] - Block
InConversion
:
CommonConversion
(
Exists
:
True
,
IsIdentity
:
True
,
IsNumeric
:
False
,
IsReference
:
False
,
IsUserDefined
:
False
)
(
MethodSymbol
:
null
)
InConversion
:
CommonConversion
(
Exists
:
True
,
IsIdentity
:
True
,
IsNumeric
:
False
,
IsReference
:
False
,
IsUserDefined
:
False
)
(
MethodSymbol
:
null
)
OutConversion
:
CommonConversion
(
Exists
:
True
,
IsIdentity
:
True
,
IsNumeric
:
False
,
IsReference
:
False
,
IsUserDefined
:
False
)
(
MethodSymbol
:
null
)
OutConversion
:
CommonConversion
(
Exists
:
True
,
IsIdentity
:
True
,
IsNumeric
:
False
,
IsReference
:
False
,
IsUserDefined
:
False
)
(
MethodSymbol
:
null
)
IArgumentOperation
(
ArgumentKind
.
Explicit
,
Matching
Parameter
:
lockTaken
)
(
OperationKind
.
Argument
,
Type
:
null
,
IsImplicit
)
(
Syntax
:
'Nothing')
IArgumentOperation
(
ArgumentKind
.
Explicit
,
Matching
Parameter
:
lockTaken
)
(
OperationKind
.
Argument
,
Type
:
null
,
IsImplicit
)
(
Syntax
:
'Nothing')
ILocalReferenceOperation
:
(
OperationKind
.
LocalReference
,
Type
:
System
.
Boolean
,
Constant
:
null
,
IsImplicit
)
(
Syntax
:
'Nothing')
ILocalReferenceOperation
:
(
IsDeclaration
:
True
)
(
OperationKind
.
LocalReference
,
Type
:
System
.
Boolean
,
Constant
:
null
,
IsImplicit
)
(
Syntax
:
'Nothing')
InConversion
:
CommonConversion
(
Exists
:
True
,
IsIdentity
:
True
,
IsNumeric
:
False
,
IsReference
:
False
,
IsUserDefined
:
False
)
(
MethodSymbol
:
null
)
InConversion
:
CommonConversion
(
Exists
:
True
,
IsIdentity
:
True
,
IsNumeric
:
False
,
IsReference
:
False
,
IsUserDefined
:
False
)
(
MethodSymbol
:
null
)
OutConversion
:
CommonConversion
(
Exists
:
True
,
IsIdentity
:
True
,
IsNumeric
:
False
,
IsReference
:
False
,
IsUserDefined
:
False
)
(
MethodSymbol
:
null
)
OutConversion
:
CommonConversion
(
Exists
:
True
,
IsIdentity
:
True
,
IsNumeric
:
False
,
IsReference
:
False
,
IsUserDefined
:
False
)
(
MethodSymbol
:
null
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录