Author: raja
Date: 2007-05-28 00:33:25 -0400 (Mon, 28 May 2007)
New Revision: 78025
Modified:
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/flowanalysis.cs
trunk/mcs/mcs/statement.cs
Log:
Kill Block.Implicit
* statement.cs (Block.Implicit): Remove.
(Block): Update to changes.
* flowanalysis.cs: Likewise.
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2007-05-28 03:35:21 UTC (rev 78024)
+++ trunk/mcs/mcs/ChangeLog 2007-05-28 04:33:25 UTC (rev 78025)
@@ -1,5 +1,10 @@
2007-05-27 Raja R Harinath <[EMAIL PROTECTED]>
+ Kill Block.Implicit
+ * statement.cs (Block.Implicit): Remove.
+ (Block): Update to changes.
+ * flowanalysis.cs: Likewise.
+
Mildly speed up CheckInvariantMeaningInBlock
* statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
Recursively call AddKnownVariable to all enclosing blocks.
Modified: trunk/mcs/mcs/flowanalysis.cs
===================================================================
--- trunk/mcs/mcs/flowanalysis.cs 2007-05-28 03:35:21 UTC (rev 78024)
+++ trunk/mcs/mcs/flowanalysis.cs 2007-05-28 04:33:25 UTC (rev 78025)
@@ -407,8 +407,18 @@
// </summary>
public UsageVector MergeChild (FlowBranching child)
{
- bool overwrite = child.Type == BranchingType.Labeled ||
- (child.Type == BranchingType.Block &&
child.Block != null && child.Block.Implicit);
+ bool overwrite = false;
+
+ switch (child.Type) {
+ case BranchingType.Labeled:
+ overwrite = true;
+ break;
+ case BranchingType.Block:
+ if (child.Block != null && child.Block !=
child.Block.Explicit)
+ overwrite = true;
+ break;
+ }
+
Report.Debug (2, " MERGING CHILD", this, child);
UsageVector result = CurrentUsageVector.MergeChild
(child.Merge (), overwrite);
Report.Debug (2, " MERGING CHILD DONE", this, result);
Modified: trunk/mcs/mcs/statement.cs
===================================================================
--- trunk/mcs/mcs/statement.cs 2007-05-28 03:35:21 UTC (rev 78024)
+++ trunk/mcs/mcs/statement.cs 2007-05-28 04:33:25 UTC (rev 78025)
@@ -1460,10 +1460,6 @@
}
protected Flags flags;
- public bool Implicit {
- get { return (flags & Flags.IsExplicit) == 0; }
- }
-
public bool Unchecked {
get { return (flags & Flags.Unchecked) != 0; }
set { flags |= Flags.Unchecked; }
@@ -1622,7 +1618,7 @@
return false;
}
- if (!Implicit)
+ if (this == Explicit)
break;
cur = cur.Parent;
@@ -1668,7 +1664,7 @@
return null;
foreach (Block child in children) {
- if (!child.Implicit)
+ if (Explicit != child.Explicit)
continue;
s = child.LookupLabel (name);
@@ -1766,7 +1762,7 @@
return false;
Block b = this;
- while (b.Implicit) {
+ while (b != Explicit) {
if (!b.Parent.DoCheckError136_InChildren (name,
loc))
return false;
b = b.Parent;
@@ -2314,7 +2310,7 @@
ec.CurrentBlock = this;
bool emit_debug_info = (CodeGen.SymbolWriter != null);
- bool is_lexical_block = !Implicit && (Parent != null);
+ bool is_lexical_block = this == Explicit && Parent !=
null;
if (emit_debug_info) {
if (is_lexical_block)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches