Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
3f4dbb52
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,发现更多精彩内容 >>
未验证
提交
3f4dbb52
编写于
3月 27, 2018
作者:
A
AlekseyTs
提交者:
GitHub
3月 27, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add BasicBlock.IsReachable property. (#25698)
上级
9888b3a4
变更
15
展开全部
隐藏空白更改
内联
并排
Showing
15 changed file
with
5006 addition
and
119 deletion
+5006
-119
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IBranchOperation.cs
...t/Semantic/IOperation/IOperationTests_IBranchOperation.cs
+1
-1
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ICoalesceOperation.cs
...Semantic/IOperation/IOperationTests_ICoalesceOperation.cs
+4
-4
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IIfStatement.cs
.../Test/Semantic/IOperation/IOperationTests_IIfStatement.cs
+1
-1
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IReturnStatement.cs
...t/Semantic/IOperation/IOperationTests_IReturnStatement.cs
+4
-4
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IThrowOperation.cs
...st/Semantic/IOperation/IOperationTests_IThrowOperation.cs
+27
-27
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_TryCatch.cs
...harp/Test/Semantic/IOperation/IOperationTests_TryCatch.cs
+4334
-23
src/Compilers/Core/Portable/Operations/BasicBlock.cs
src/Compilers/Core/Portable/Operations/BasicBlock.cs
+2
-0
src/Compilers/Core/Portable/Operations/ControlFlowGraph.Region.cs
...ilers/Core/Portable/Operations/ControlFlowGraph.Region.cs
+5
-0
src/Compilers/Core/Portable/Operations/ControlFlowGraphBuilder.cs
...ilers/Core/Portable/Operations/ControlFlowGraphBuilder.cs
+349
-5
src/Compilers/Core/Portable/PublicAPI.Unshipped.txt
src/Compilers/Core/Portable/PublicAPI.Unshipped.txt
+1
-0
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IBranchOperation.vb
...t/Semantic/IOperation/IOperationTests_IBranchOperation.vb
+40
-40
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_ICoalesceOperation.vb
...Semantic/IOperation/IOperationTests_ICoalesceOperation.vb
+3
-3
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IEndOperation.vb
...Test/Semantic/IOperation/IOperationTests_IEndOperation.vb
+10
-10
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_TryCatch.vb
...asic/Test/Semantic/IOperation/IOperationTests_TryCatch.vb
+215
-0
src/Test/Utilities/Portable/Compilation/ControlFlowGraphVerifier.cs
...tilities/Portable/Compilation/ControlFlowGraphVerifier.cs
+10
-1
未找到文件。
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IBranchOperation.cs
浏览文件 @
3f4dbb52
...
...
@@ -1050,7 +1050,7 @@ void M(bool x)
Leaving: {R6} {R1}
}
Block[B5] - Block
Block[B5] - Block
[UnReachable]
Predecessors (0)
Statements (1)
IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'x = true;')
...
...
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ICoalesceOperation.cs
浏览文件 @
3f4dbb52
...
...
@@ -622,7 +622,7 @@ void F(dynamic alternative, dynamic result)
IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: null, Constant: null, IsImplicit) (Syntax: 'null')
Next (Regular) Block[B2]
Block[B2] - Block
Block[B2] - Block
[UnReachable]
Predecessors: [B1]
Statements (1)
IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'null')
...
...
@@ -717,7 +717,7 @@ void F(int alternative, int result)
IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: null, Constant: null, IsInvalid, IsImplicit) (Syntax: 'null')
Next (Regular) Block[B2]
Block[B2] - Block
Block[B2] - Block
[UnReachable]
Predecessors: [B1]
Statements (1)
IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsInvalid, IsImplicit) (Syntax: 'null')
...
...
@@ -810,7 +810,7 @@ void F(int? alternative, int? result)
IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: null, Constant: null, IsImplicit) (Syntax: 'null')
Next (Regular) Block[B2]
Block[B2] - Block
Block[B2] - Block
[UnReachable]
Predecessors: [B1]
Statements (1)
IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'null')
...
...
@@ -1203,7 +1203,7 @@ void F(object alternative, object result)
IFlowCaptureReferenceOperation: 1 (OperationKind.FlowCaptureReference, Type: System.String, Constant: ""a"", IsImplicit) (Syntax: 'input')
Next (Regular) Block[B4]
Block[B3] - Block
Block[B3] - Block
[UnReachable]
Predecessors: [B1]
Statements (1)
IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'alternative')
...
...
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IIfStatement.cs
浏览文件 @
3f4dbb52
...
...
@@ -1277,7 +1277,7 @@ void M()
Next (Regular) Block[B3]
Leaving: {R1}
Block[B2] - Block
Block[B2] - Block
[UnReachable]
Predecessors: [B1]
Statements (1)
IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'condition = true;')
...
...
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IReturnStatement.cs
浏览文件 @
3f4dbb52
...
...
@@ -223,7 +223,7 @@ void F(bool a)
Block[B0] - Entry
Statements (0)
Next (Regular) Block[B2]
Block[B1] - Block
Block[B1] - Block
[UnReachable]
Predecessors (0)
Statements (1)
IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'a = true;')
...
...
@@ -273,7 +273,7 @@ int F(bool a)
Statements (0)
Next (Return) Block[B3]
ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 1) (Syntax: '1')
Block[B2] - Block
Block[B2] - Block
[UnReachable]
Predecessors (0)
Statements (1)
IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'a = true;')
...
...
@@ -624,7 +624,7 @@ int F()
Statements (0)
Next (Return) Block[B3]
ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 1) (Syntax: '1')
Block[B2] - Block
Block[B2] - Block
[UnReachable]
Predecessors (0)
Statements (0)
Next (Return) Block[B3]
...
...
@@ -1189,7 +1189,7 @@ System.Collections.Generic.IEnumerable<int> F(bool a)
Block[B0] - Entry
Statements (0)
Next (Regular) Block[B2]
Block[B1] - Block
Block[B1] - Block
[UnReachable]
Predecessors (0)
Statements (1)
IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'a = true;')
...
...
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IThrowOperation.cs
浏览文件 @
3f4dbb52
...
...
@@ -39,7 +39,7 @@ void F()
Predecessors: [B0]
Statements (0)
Next (ReThrow) Block[null]
Block[B2] - Exit
Block[B2] - Exit
[UnReachable]
Predecessors (0)
Statements (0)
"
;
...
...
@@ -88,7 +88,7 @@ void F(int x)
ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 1) (Syntax: '1')
Next (ReThrow) Block[null]
Block[B2] - Block
Block[B2] - Block
[UnReachable]
Predecessors (0)
Statements (1)
IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'x = 2;')
...
...
@@ -100,7 +100,7 @@ void F(int x)
ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 2) (Syntax: '2')
Next (Regular) Block[B3]
Block[B3] - Exit
Block[B3] - Exit
[UnReachable]
Predecessors: [B2]
Statements (0)
"
;
...
...
@@ -133,7 +133,7 @@ void F(System.Exception ex)
Statements (0)
Next (Throw) Block[null]
IParameterReferenceOperation: ex (OperationKind.ParameterReference, Type: System.Exception) (Syntax: 'ex')
Block[B2] - Exit
Block[B2] - Exit
[UnReachable]
Predecessors (0)
Statements (0)
"
;
...
...
@@ -186,7 +186,7 @@ void F(System.Exception ex)
Next (Throw) Block[null]
IParameterReferenceOperation: ex (OperationKind.ParameterReference, Type: System.Exception) (Syntax: 'ex')
Block[B2] - Block
Block[B2] - Block
[UnReachable]
Predecessors (0)
Statements (1)
IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'x = 2;')
...
...
@@ -201,7 +201,7 @@ void F(System.Exception ex)
Leaving: {R1}
}
Block[B3] - Exit
Block[B3] - Exit
[UnReachable]
Predecessors: [B2]
Statements (0)
"
;
...
...
@@ -249,7 +249,7 @@ void F(int x, System.Exception ex)
IParameterReferenceOperation: ex (OperationKind.ParameterReference, Type: System.Exception, IsInvalid) (Syntax: 'ex')
Right:
IParameterReferenceOperation: x (OperationKind.ParameterReference, Type: System.Int32, IsInvalid) (Syntax: 'x')
Block[B2] - Block
Block[B2] - Block
[UnReachable]
Predecessors (0)
Statements (1)
IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null, IsInvalid) (Syntax: 'x = throw ex + x;')
...
...
@@ -267,7 +267,7 @@ void F(int x, System.Exception ex)
IOperation: (OperationKind.None, Type: null, IsInvalid, IsImplicit) (Syntax: 'throw ex + x')
Next (Regular) Block[B3]
Block[B3] - Exit
Block[B3] - Exit
[UnReachable]
Predecessors: [B2]
Statements (0)
"
;
...
...
@@ -308,7 +308,7 @@ void F(int x, System.Exception ex)
Next (Throw) Block[null]
IParameterReferenceOperation: ex (OperationKind.ParameterReference, Type: System.Exception) (Syntax: 'ex')
Block[B2] - Block
Block[B2] - Block
[UnReachable]
Predecessors (0)
Statements (1)
IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null, IsInvalid) (Syntax: 'x = (throw ex) + x;')
...
...
@@ -330,7 +330,7 @@ void F(int x, System.Exception ex)
IParameterReferenceOperation: x (OperationKind.ParameterReference, Type: System.Int32) (Syntax: 'x')
Next (Regular) Block[B3]
Block[B3] - Exit
Block[B3] - Exit
[UnReachable]
Predecessors: [B2]
Statements (0)
"
;
...
...
@@ -375,7 +375,7 @@ void F(int x, System.Exception ex)
Next (Throw) Block[null]
IParameterReferenceOperation: ex (OperationKind.ParameterReference, Type: System.Exception, IsInvalid) (Syntax: 'ex')
Block[B2] - Block
Block[B2] - Block
[UnReachable]
Predecessors (0)
Statements (1)
IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null, IsInvalid) (Syntax: 'x = x + throw ex;')
...
...
@@ -397,7 +397,7 @@ void F(int x, System.Exception ex)
IOperation: (OperationKind.None, Type: null, IsInvalid, IsImplicit) (Syntax: 'throw ex')
Next (Regular) Block[B3]
Block[B3] - Exit
Block[B3] - Exit
[UnReachable]
Predecessors: [B2]
Statements (0)
"
;
...
...
@@ -442,7 +442,7 @@ void F(int x, System.Exception ex)
Next (Throw) Block[null]
IParameterReferenceOperation: ex (OperationKind.ParameterReference, Type: System.Exception) (Syntax: 'ex')
Block[B2] - Block
Block[B2] - Block
[UnReachable]
Predecessors (0)
Statements (1)
IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null, IsInvalid) (Syntax: 'x = x + (throw ex);')
...
...
@@ -464,7 +464,7 @@ void F(int x, System.Exception ex)
IOperation: (OperationKind.None, Type: null, IsInvalid, IsImplicit) (Syntax: 'throw ex')
Next (Regular) Block[B3]
Block[B3] - Exit
Block[B3] - Exit
[UnReachable]
Predecessors: [B2]
Statements (0)
"
;
...
...
@@ -522,7 +522,7 @@ void F(object x, object y, System.Exception ex)
Statements (0)
Next (Throw) Block[null]
IParameterReferenceOperation: ex (OperationKind.ParameterReference, Type: System.Exception) (Syntax: 'ex')
Block[B4] - Block
Block[B4] - Block
[UnReachable]
Predecessors (0)
Statements (1)
IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'throw ex')
...
...
@@ -606,7 +606,7 @@ void F(object x, object y, object z, System.Exception ex)
Statements (0)
Next (Throw) Block[null]
IParameterReferenceOperation: ex (OperationKind.ParameterReference, Type: System.Exception) (Syntax: 'ex')
Block[B4] - Block
Block[B4] - Block
[UnReachable]
Predecessors (0)
Statements (1)
IFlowCaptureOperation: 2 (OperationKind.FlowCapture, Type: null, IsImplicit) (Syntax: 'throw ex')
...
...
@@ -779,7 +779,7 @@ void F(int u)
ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 2) (Syntax: '2')
Next (ReThrow) Block[null]
Block[B3] - Block
Block[B3] - Block
[UnReachable]
Predecessors (0)
Statements (1)
IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'u = 3;')
...
...
@@ -885,7 +885,7 @@ void F(object x, object y, object z, int u)
Next (Throw) Block[null]
IInvalidOperation (OperationKind.Invalid, Type: null, IsInvalid) (Syntax: '')
Children(0)
Block[B5] - Block
Block[B5] - Block
[UnReachable]
Predecessors (0)
Statements (1)
IFlowCaptureOperation: 1 (OperationKind.FlowCapture, Type: null, IsInvalid, IsImplicit) (Syntax: 'throw')
...
...
@@ -958,7 +958,7 @@ void F(System.Exception ex)
Next (Throw) Block[null]
IParameterReferenceOperation: ex (OperationKind.ParameterReference, Type: System.Exception) (Syntax: 'ex')
Block[B2] - Exit
Block[B2] - Exit
[UnReachable]
Predecessors (0)
Statements (0)
"
;
...
...
@@ -1072,7 +1072,7 @@ void F(System.Exception ex, bool a)
Statements (0)
Next (Throw) Block[null]
IParameterReferenceOperation: ex (OperationKind.ParameterReference, Type: System.Exception) (Syntax: 'ex')
Block[B3] - Exit
Block[B3] - Exit
[UnReachable]
Predecessors (0)
Statements (0)
"
;
...
...
@@ -1195,7 +1195,7 @@ void F(System.Exception ex)
Statements (0)
Next (Throw) Block[null]
IParameterReferenceOperation: ex (OperationKind.ParameterReference, Type: System.Exception) (Syntax: 'ex')
Block[B3] - Exit
Block[B3] - Exit
[UnReachable]
Predecessors (0)
Statements (0)
"
;
...
...
@@ -1345,7 +1345,7 @@ void F(System.Exception ex, int x)
Statements (0)
Next (Throw) Block[null]
IParameterReferenceOperation: ex (OperationKind.ParameterReference, Type: System.Exception) (Syntax: 'ex')
Block[B3] - Block
Block[B3] - Block
[UnReachable]
Predecessors (0)
Statements (1)
IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'x = 2;')
...
...
@@ -1425,7 +1425,7 @@ void F(int x)
Predecessors: [B3]
Statements (0)
Next (ReThrow) Block[null]
Block[B3] - Block
Block[B3] - Block
[UnReachable]
Predecessors (0)
Statements (1)
IExpressionStatementOperation (OperationKind.ExpressionStatement, Type: null) (Syntax: 'x = 2;')
...
...
@@ -1486,7 +1486,7 @@ int F(bool a, System.Exception ex1, System.Exception ex2)
Statements (0)
Next (Throw) Block[null]
IParameterReferenceOperation: ex2 (OperationKind.ParameterReference, Type: System.Exception) (Syntax: 'ex2')
Block[B3] - Exit
Block[B3] - Exit
[UnReachable]
Predecessors (0)
Statements (0)
"
;
...
...
@@ -1541,7 +1541,7 @@ void F(int x, System.Exception ex1, System.Exception ex2, bool a)
Statements (0)
Next (Throw) Block[null]
IParameterReferenceOperation: ex2 (OperationKind.ParameterReference, Type: System.Exception) (Syntax: 'ex2')
Block[B3] - Exit
Block[B3] - Exit
[UnReachable]
Predecessors (0)
Statements (0)
"
;
...
...
@@ -1843,7 +1843,7 @@ void F(int u)
Next (ReThrow) Block[null]
}
Block[B3] - Exit
Block[B3] - Exit
[UnReachable]
Predecessors: [B1]
Statements (0)
"
;
...
...
@@ -1906,7 +1906,7 @@ void F(int u, System.Exception ex)
IParameterReferenceOperation: ex (OperationKind.ParameterReference, Type: System.Exception) (Syntax: 'ex')
}
Block[B3] - Exit
Block[B3] - Exit
[UnReachable]
Predecessors: [B1]
Statements (0)
"
;
...
...
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_TryCatch.cs
浏览文件 @
3f4dbb52
此差异已折叠。
点击以展开。
src/Compilers/Core/Portable/Operations/BasicBlock.cs
浏览文件 @
3f4dbb52
...
...
@@ -54,6 +54,8 @@ public BasicBlock(BasicBlockKind kind)
public
int
Ordinal
{
get
;
internal
set
;
}
=
-
1
;
public
bool
IsReachable
{
get
;
internal
set
;
}
=
false
;
/// <summary>
/// Enclosing region
/// </summary>
...
...
src/Compilers/Core/Portable/Operations/ControlFlowGraph.Region.cs
浏览文件 @
3f4dbb52
...
...
@@ -190,6 +190,11 @@ public sealed class Region
}
#endif
}
internal
bool
ContainsBlock
(
int
destinationOrdinal
)
{
return
FirstBlockOrdinal
<=
destinationOrdinal
&&
LastBlockOrdinal
>=
destinationOrdinal
;
}
}
}
}
src/Compilers/Core/Portable/Operations/ControlFlowGraphBuilder.cs
浏览文件 @
3f4dbb52
此差异已折叠。
点击以展开。
src/Compilers/Core/Portable/PublicAPI.Unshipped.txt
浏览文件 @
3f4dbb52
...
...
@@ -32,6 +32,7 @@ Microsoft.CodeAnalysis.Operations.BasicBlock.BranchKind.Return = 2 -> Microsoft.
Microsoft.CodeAnalysis.Operations.BasicBlock.BranchKind.StructuredExceptionHandling = 3 -> Microsoft.CodeAnalysis.Operations.BasicBlock.BranchKind
Microsoft.CodeAnalysis.Operations.BasicBlock.BranchKind.Throw = 5 -> Microsoft.CodeAnalysis.Operations.BasicBlock.BranchKind
Microsoft.CodeAnalysis.Operations.BasicBlock.Conditional.get -> (Microsoft.CodeAnalysis.IOperation Condition, bool JumpIfTrue, Microsoft.CodeAnalysis.Operations.BasicBlock.Branch Branch)
Microsoft.CodeAnalysis.Operations.BasicBlock.IsReachable.get -> bool
Microsoft.CodeAnalysis.Operations.BasicBlock.Kind.get -> Microsoft.CodeAnalysis.Operations.BasicBlockKind
Microsoft.CodeAnalysis.Operations.BasicBlock.Next.get -> (Microsoft.CodeAnalysis.IOperation Value, Microsoft.CodeAnalysis.Operations.BasicBlock.Branch Branch)
Microsoft.CodeAnalysis.Operations.BasicBlock.Ordinal.get -> int
...
...
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IBranchOperation.vb
浏览文件 @
3f4dbb52
此差异已折叠。
点击以展开。
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_ICoalesceOperation.vb
浏览文件 @
3f4dbb52
...
...
@@ -659,7 +659,7 @@ Block[B1] - Block
IFlowCaptureReferenceOperation
:
1
(
OperationKind
.
FlowCaptureReference
,
Type
:
null
,
Constant
:
null
,
IsImplicit
)
(
Syntax
:
'Nothing')
Next
(
Regular
)
Block
[
B2
]
Block
[
B2
]
-
Block
Block
[
B2
]
-
Block
[
UnReachable
]
Predecessors
:
[
B1
]
Statements
(
1
)
IFlowCaptureOperation
:
2
(
OperationKind
.
FlowCapture
,
Type
:
null
,
IsImplicit
)
(
Syntax
:
'Nothing')
...
...
@@ -755,7 +755,7 @@ Block[B1] - Block
IFlowCaptureReferenceOperation
:
1
(
OperationKind
.
FlowCaptureReference
,
Type
:
null
,
Constant
:
null
,
IsImplicit
)
(
Syntax
:
'Nothing')
Next
(
Regular
)
Block
[
B2
]
Block
[
B2
]
-
Block
Block
[
B2
]
-
Block
[
UnReachable
]
Predecessors
:
[
B1
]
Statements
(
1
)
IFlowCaptureOperation
:
2
(
OperationKind
.
FlowCapture
,
Type
:
null
,
IsImplicit
)
(
Syntax
:
'Nothing')
...
...
@@ -851,7 +851,7 @@ Block[B1] - Block
IFlowCaptureReferenceOperation
:
1
(
OperationKind
.
FlowCaptureReference
,
Type
:
null
,
Constant
:
null
,
IsImplicit
)
(
Syntax
:
'Nothing')
Next
(
Regular
)
Block
[
B2
]
Block
[
B2
]
-
Block
Block
[
B2
]
-
Block
[
UnReachable
]
Predecessors
:
[
B1
]
Statements
(
1
)
IFlowCaptureOperation
:
2
(
OperationKind
.
FlowCapture
,
Type
:
null
,
IsImplicit
)
(
Syntax
:
'Nothing')
...
...
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IEndOperation.vb
浏览文件 @
3f4dbb52
...
...
@@ -28,7 +28,7 @@ Block[B1] - Block
Predecessors
:
[
B0
]
Statements
(
0
)
Next
(
ProgramTermination
)
Block
[
null
]
Block
[
B2
]
-
Exit
Block
[
B2
]
-
Exit
[
UnReachable
]
Predecessors
(
0
)
Statements
(
0
)
]]
>
.
Value
...
...
@@ -69,7 +69,7 @@ Block[B1] - Block
ILiteralOperation
(
OperationKind
.
Literal
,
Type
:
System
.
Int32
,
Constant
:
1
)
(
Syntax
:
'1')
Next
(
ProgramTermination
)
Block
[
null
]
Block
[
B2
]
-
Block
Block
[
B2
]
-
Block
[
UnReachable
]
Predecessors
(
0
)
Statements
(
1
)
IExpressionStatementOperation
(
OperationKind
.
ExpressionStatement
,
Type
:
null
)
(
Syntax
:
'x = 2')
...
...
@@ -81,7 +81,7 @@ Block[B2] - Block
ILiteralOperation
(
OperationKind
.
Literal
,
Type
:
System
.
Int32
,
Constant
:
2
)
(
Syntax
:
'2')
Next
(
Regular
)
Block
[
B3
]
Block
[
B3
]
-
Exit
Block
[
B3
]
-
Exit
[
UnReachable
]
Predecessors
:
[
B2
]
Statements
(
0
)
]]
>
.
Value
...
...
@@ -139,7 +139,7 @@ Block[B0] - Entry
Next
(
ProgramTermination
)
Block
[
null
]
}
Block
[
B3
]
-
Exit
Block
[
B3
]
-
Exit
[
UnReachable
]
Predecessors
:
[
B1
]
Statements
(
0
)
]]
>
.
Value
...
...
@@ -182,7 +182,7 @@ Block[B1] - Block
ILiteralOperation
(
OperationKind
.
Literal
,
Type
:
System
.
Int32
,
Constant
:
1
)
(
Syntax
:
'1')
Next
(
ProgramTermination
)
Block
[
null
]
Block
[
B2
]
-
Exit
Block
[
B2
]
-
Exit
[
UnReachable
]
Predecessors
(
0
)
Statements
(
0
)
]]
>
.
Value
...
...
@@ -218,7 +218,7 @@ Block[B1] - Block
IParameterReferenceOperation
:
x
(
OperationKind
.
ParameterReference
,
Type
:
System
.
Boolean
)
(
Syntax
:
'x')
Next
(
ProgramTermination
)
Block
[
null
]
Block
[
B2
]
-
Exit
Block
[
B2
]
-
Exit
[
UnReachable
]
Predecessors
(
0
)
Statements
(
0
)
]]
>
.
Value
...
...
@@ -276,7 +276,7 @@ Block[B3] - Block
Predecessors
:
[
B1
]
[
B2
]
Statements
(
0
)
Next
(
ProgramTermination
)
Block
[
null
]
Block
[
B4
]
-
Exit
Block
[
B4
]
-
Exit
[
UnReachable
]
Predecessors
(
0
)
Statements
(
0
)
]]
>
.
Value
...
...
@@ -324,7 +324,7 @@ Block[B1] - Block
IParameterReferenceOperation
:
a
(
OperationKind
.
ParameterReference
,
Type
:
System
.
Boolean
)
(
Syntax
:
'a')
Next
(
ProgramTermination
)
Block
[
null
]
Block
[
B2
]
-
Exit
Block
[
B2
]
-
Exit
[
UnReachable
]
Predecessors
(
0
)
Statements
(
0
)
]]
>
.
Value
...
...
@@ -463,7 +463,7 @@ Block[B0] - Entry
}
.
finally
{
R3
}
{
Block
[
B2
]
-
Block
Block
[
B2
]
-
Block
[
UnReachable
]
Predecessors
(
0
)
Statements
(
1
)
IExpressionStatementOperation
(
OperationKind
.
ExpressionStatement
,
Type
:
null
)
(
Syntax
:
'x = 1')
...
...
@@ -477,7 +477,7 @@ Block[B0] - Entry
Next
(
StructuredExceptionHandling
)
Block
[
null
]
}
Block
[
B3
]
-
Exit
Block
[
B3
]
-
Exit
[
UnReachable
]
Predecessors
(
0
)
Statements
(
0
)
]]
>
.
Value
...
...
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_TryCatch.vb
浏览文件 @
3f4dbb52
此差异已折叠。
点击以展开。
src/Test/Utilities/Portable/Compilation/ControlFlowGraphVerifier.cs
浏览文件 @
3f4dbb52
...
...
@@ -57,6 +57,7 @@ public static string GetFlowGraph(Compilation compilation, ControlFlowGraph grap
Assert
.
Null
(
currentRegion
.
ExceptionType
);
Assert
.
Empty
(
currentRegion
.
Locals
);
Assert
.
Equal
(
ControlFlowGraph
.
RegionKind
.
Root
,
currentRegion
.
Kind
);
Assert
.
True
(
block
.
IsReachable
);
break
;
case
BasicBlockKind
.
Exit
:
...
...
@@ -85,7 +86,7 @@ public static string GetFlowGraph(Compilation compilation, ControlFlowGraph grap
stringBuilder
.
AppendLine
();
}
appendLine
(
$"Block[B
{
i
}
] -
{
block
.
Kind
}
"
);
appendLine
(
$"Block[B
{
i
}
] -
{
block
.
Kind
}
{(
block
.
IsReachable
?
""
:
" [UnReachable]"
)}
"
);
var
predecessors
=
block
.
Predecessors
;
...
...
@@ -130,6 +131,7 @@ public static string GetFlowGraph(Compilation compilation, ControlFlowGraph grap
Assert
.
Same
(
blocks
[
conditionalBranch
.
Destination
.
Ordinal
],
conditionalBranch
.
Destination
);
}
Assert
.
NotEqual
(
BasicBlock
.
BranchKind
.
StructuredExceptionHandling
,
conditionalBranch
.
Kind
);
appendLine
(
$" Jump if
{(
block
.
Conditional
.
JumpIfTrue
?
"True"
:
"False"
)}
(
{
conditionalBranch
.
Kind
}
) to Block[
{
getDestinationString
(
ref
conditionalBranch
)}
]"
);
IOperation
value
=
block
.
Conditional
.
Condition
;
...
...
@@ -153,6 +155,13 @@ public static string GetFlowGraph(Compilation compilation, ControlFlowGraph grap
Assert
.
Same
(
blocks
[
nextBranch
.
Destination
.
Ordinal
],
nextBranch
.
Destination
);
}
if
(
nextBranch
.
Kind
==
BasicBlock
.
BranchKind
.
StructuredExceptionHandling
)
{
Assert
.
Null
(
nextBranch
.
Destination
);
Assert
.
Equal
(
block
.
Region
.
LastBlockOrdinal
,
block
.
Ordinal
);
Assert
.
True
(
block
.
Region
.
Kind
==
ControlFlowGraph
.
RegionKind
.
Filter
||
block
.
Region
.
Kind
==
ControlFlowGraph
.
RegionKind
.
Finally
);
}
appendLine
(
$" Next (
{
nextBranch
.
Kind
}
) Block[
{
getDestinationString
(
ref
nextBranch
)}
]"
);
IOperation
value
=
block
.
Next
.
Value
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录