Skip to content

Commit 0067e69

Browse files
committed
WI #2022 Change review
1 parent 96ffab5 commit 0067e69

File tree

4 files changed

+5
-13
lines changed

4 files changed

+5
-13
lines changed

TypeCobol.Analysis/Cfg/ControlFlowGraphBuilder.CfgAfterIterativePerformProcedureTransformer.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,12 @@ public partial class ControlFlowGraphBuilder<D>
1212
private class CfgAfterIterativePerformProcedureTransformer : ICfgTransform<Node, D>
1313
{
1414
private HashSet<BasicBlockForNodeGroup> _visitedGroups;
15-
private ControlFlowGraph<Node, D> _cfg;
1615

1716
/// <summary>
1817
/// Constructor
1918
/// </summary>
20-
/// <param name="builder"></param>
21-
public CfgAfterIterativePerformProcedureTransformer(ControlFlowGraph<Node, D> cfg)
19+
public CfgAfterIterativePerformProcedureTransformer()
2220
{
23-
this._cfg = cfg;
2421
}
2522
private bool Callback(BasicBlock<Node, D> block, int incomingEdge, BasicBlock<Node, D> predecessorBlock, ControlFlowGraph<Node, D> cfg)
2623
{
@@ -57,7 +54,7 @@ private bool Callback(BasicBlock<Node, D> block, int incomingEdge, BasicBlock<No
5754
cfg.SuccessorEdges.Add(iterativeGroup.Group.First.Value);
5855
block.SuccessorEdges.Add(entranceEdge);
5956
System.Diagnostics.Debug.Assert(block.Context == null);
60-
//If the assert above fails (it should not be case), then it will be necessay to exeute the commented code bellow.
57+
//If the assert above fails (it should not be case), then it will be necessary to exeute the commented code below.
6158
//if(block.Context != null)
6259
//{
6360
// ((MultiBranchContext)block.Context).ChangeSuccessor(_cfg, iterativeGroup, iterativeGroup.Group.First.Value);

TypeCobol.Analysis/Cfg/ControlFlowGraphBuilder.MultiBranchContext.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ internal class MultiBranchContext : IMultiBranchContext<Node, D>
1818
/// <summary>
1919
/// List of multi branch blocks
2020
/// </summary>
21-
internal List<BasicBlock<Node, D>> Branches;
21+
public IList<BasicBlock<Node, D>> Branches { get; internal set; }
2222
/// <summary>
2323
/// Indices in the SuccessorEdges of all blocks in Branches
2424
/// </summary>
25-
internal List<int> BranchIndices;
25+
public IList<int> BranchIndices { get; internal set; }
2626
/// <summary>
2727
/// Root Block of the multi branches
2828
/// </summary>
@@ -62,10 +62,6 @@ internal class MultiBranchContext : IMultiBranchContext<Node, D>
6262

6363
BasicBlock<Node, D> IMultiBranchContext<Node, D>.RootBlock => this.RootBlock;
6464

65-
IList<BasicBlock<Node, D>> IMultiBranchContext<Node, D>.Branches => this.Branches;
66-
67-
IList<int> IMultiBranchContext<Node, D>.BranchIndices => this.BranchIndices;
68-
6965
/// <summary>
7066
/// Constructor
7167
/// </summary>

TypeCobol.Analysis/Cfg/ControlFlowGraphBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,7 @@ private void HandlePerformsWithTestAfter()
13331333
{
13341334
//Transform graph to replace edge in performs with test after.
13351335
//Transformation is directly applied to the graph, no new instance created.
1336-
ICfgTransform<Node, D> transform = new CfgAfterIterativePerformProcedureTransformer(this.CurrentProgramCfgBuilder.Cfg);
1336+
ICfgTransform<Node, D> transform = new CfgAfterIterativePerformProcedureTransformer();
13371337
transform.Transform(this.CurrentProgramCfgBuilder.Cfg);
13381338
}
13391339
}

TypeCobol.Analysis/Graph/IMultiBranchContext.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,5 @@ public interface IMultiBranchContext<N, D>
4646
/// For instance in COBOL EVALUATE Context has all WHEN and WHENOTHER as sub contexts.
4747
/// </summary>
4848
IList<IMultiBranchContext<N, D>> SubContexts { get; }
49-
5049
}
5150
}

0 commit comments

Comments
 (0)