Minor cleanups in flowanalysis.cs
authorRaja R Harinath <harinath@hurrynot.org>
Wed, 2 Apr 2008 19:48:29 +0000 (19:48 -0000)
committerRaja R Harinath <harinath@hurrynot.org>
Wed, 2 Apr 2008 19:48:29 +0000 (19:48 -0000)
* flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
(FlowBranching.CreateBranching): Update to changes.
(FlowBranchingBlock.AddSibling): Add sanity check.
* codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
Update to changes.

svn path=/trunk/mcs/; revision=99676

mcs/mcs/ChangeLog
mcs/mcs/codegen.cs
mcs/mcs/flowanalysis.cs

index a42ff084bcd133cdf2b387dfc796fa3c34bf3697..94460057535689f26a36fc0dc486203926aba069 100644 (file)
@@ -1,5 +1,11 @@
 2008-04-02  Raja R Harinath  <harinath@hurrynot.org>
 
+       * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
+       (FlowBranching.CreateBranching): Update to changes.
+       (FlowBranchingBlock.AddSibling): Add sanity check.
+       * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
+       Update to changes.
+
        * iterators.cs (Iterator.MarkFinally): Remove.
        * statement.cs (ExceptionStatement): Update to changes.
 
index 1ca9edec4901bd49318c57b65517710c2ed89b17..5946cf2b165bd69fcc47f71cbd48d6b9fae37a4e 100644 (file)
@@ -619,18 +619,10 @@ namespace Mono.CSharp {
                // </summary>
                public FlowBranching StartFlowBranching (Block block)
                {
-                       FlowBranching.BranchingType type;
-
-                       if ((CurrentBranching != null) &&
-                           (CurrentBranching.Type == FlowBranching.BranchingType.Switch))
-                               type = FlowBranching.BranchingType.SwitchSection;
-                       else
-                               type = FlowBranching.BranchingType.Block;
-
                        flags |= Flags.DoFlowAnalysis;
 
                        current_flow_branching = FlowBranching.CreateBranching (
-                               CurrentBranching, type, block, block.StartLocation);
+                               CurrentBranching, FlowBranching.BranchingType.Block, block, block.StartLocation);
                        return current_flow_branching;
                }
 
index 55b221f335103e7bbc68228e09a75ef3d1e9860c..89d1fe00b47464700d9cd06d729a16c934c38a88 100644 (file)
@@ -48,9 +48,6 @@ namespace Mono.CSharp
                        // Switch block.
                        Switch,
 
-                       // Switch section.
-                       SwitchSection,
-
                        // The toplevel block of a function
                        Toplevel
                }
@@ -78,9 +75,6 @@ namespace Mono.CSharp
                        case BranchingType.Switch:
                                return new FlowBranchingBreakable (parent, type, SiblingType.SwitchSection, block, loc);
 
-                       case BranchingType.SwitchSection:
-                               return new FlowBranchingBlock (parent, type, SiblingType.Block, block, loc);
-
                        case BranchingType.Block:
                                return new FlowBranchingBlock (parent, type, SiblingType.Block, block, loc);
 
@@ -523,6 +517,8 @@ namespace Mono.CSharp
 
                protected override void AddSibling (UsageVector sibling)
                {
+                       if (sibling.Type == SiblingType.Block && sibling_list != null)
+                               throw new InternalErrorException ("Blocks don't have sibling flow paths");
                        sibling.Next = sibling_list;
                        sibling_list = sibling;
                }