Author: raja Date: 2006-07-22 11:07:06 -0400 (Sat, 22 Jul 2006) New Revision: 62897
Modified:
trunk/mcs/gmcs/ChangeLog
trunk/mcs/gmcs/statement.cs
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/statement.cs
Log:
* statement.cs (Block.ResolveMeta): Simplify slightly.
Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog 2006-07-22 13:37:53 UTC (rev 62896)
+++ trunk/mcs/gmcs/ChangeLog 2006-07-22 15:07:06 UTC (rev 62897)
@@ -1,5 +1,7 @@
2006-07-22 Raja R Harinath <[EMAIL PROTECTED]>
+ * statement.cs (Block.ResolveMeta): Simplify slightly.
+
* codegen.cs (EmitContext.Flags): New enum. Used to represent the
multiple boolean fields. Convert InUnsafe, constant_check_state,
check_state to flags.
Modified: trunk/mcs/gmcs/statement.cs
===================================================================
--- trunk/mcs/gmcs/statement.cs 2006-07-22 13:37:53 UTC (rev 62896)
+++ trunk/mcs/gmcs/statement.cs 2006-07-22 15:07:06 UTC (rev 62897)
@@ -1719,40 +1719,39 @@
//
// Process this block variables
//
- if (variables != null){
- using (ec.WithCheckState
(ec.CheckState, (flags & Flags.Unchecked) == 0)) {
- foreach (DictionaryEntry de in
variables) {
- string name = (string)
de.Key;
- LocalInfo vi =
(LocalInfo) de.Value;
+ if (variables != null) {
+ foreach (DictionaryEntry de in
variables) {
+ string name = (string) de.Key;
+ LocalInfo vi = (LocalInfo)
de.Value;
+ Type variable_type =
vi.VariableType;
- if (vi.VariableType ==
null)
- continue;
+ if (variable_type == null)
+ continue;
- Type variable_type =
vi.VariableType;
-
- if
(variable_type.IsPointer) {
- //
- // Am not
really convinced that this test is required (Microsoft does it)
- // but the fact
is that you would not be able to use the pointer variable
- // *anyways*
- //
- if
(!TypeManager.VerifyUnManaged (TypeManager.GetElementType (variable_type),
-
vi.Location))
-
continue;
- }
-
- if (constants == null)
+ if (variable_type.IsPointer) {
+ //
+ // Am not really
convinced that this test is required (Microsoft does it)
+ // but the fact is that
you would not be able to use the pointer variable
+ // *anyways*
+ //
+ if
(!TypeManager.VerifyUnManaged (TypeManager.GetElementType (variable_type),
+
vi.Location))
continue;
+ }
- Expression cv =
(Expression) constants [name];
- if (cv == null)
- continue;
+ if (constants == null)
+ continue;
- // Don't let 'const int
Foo = Foo;' succeed.
- // Removing the name
from 'constants' ensures that we get a LocalVariableReference below,
- // which in turn causes
the 'must be constant' error to be triggered.
- constants.Remove (name);
+ Expression cv = (Expression)
constants [name];
+ if (cv == null)
+ continue;
+ // Don't let 'const int Foo =
Foo;' succeed.
+ // Removing the name from
'constants' ensures that we get a LocalVariableReference below,
+ // which in turn causes the
'must be constant' error to be triggered.
+ constants.Remove (name);
+
+ using (ec.WithCheckState
(ec.CheckState, (flags & Flags.Unchecked) == 0)) {
ec.CurrentBlock = this;
Expression e =
cv.Resolve (ec);
if (e == null)
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2006-07-22 13:37:53 UTC (rev 62896)
+++ trunk/mcs/mcs/ChangeLog 2006-07-22 15:07:06 UTC (rev 62897)
@@ -1,5 +1,7 @@
2006-07-22 Raja R Harinath <[EMAIL PROTECTED]>
+ * statement.cs (Block.ResolveMeta): Simplify slightly.
+
* codegen.cs (EmitContext.Flags): New enum. Used to represent the
multiple boolean fields. Convert InUnsafe, constant_check_state,
check_state to flags.
Modified: trunk/mcs/mcs/statement.cs
===================================================================
--- trunk/mcs/mcs/statement.cs 2006-07-22 13:37:53 UTC (rev 62896)
+++ trunk/mcs/mcs/statement.cs 2006-07-22 15:07:06 UTC (rev 62897)
@@ -1720,39 +1720,38 @@
// Process this block variables
//
if (variables != null) {
- using (ec.WithCheckState
(ec.CheckState, (flags & Flags.Unchecked) == 0)) {
- foreach (DictionaryEntry de in
variables) {
- string name = (string)
de.Key;
- LocalInfo vi =
(LocalInfo) de.Value;
+ foreach (DictionaryEntry de in
variables) {
+ string name = (string) de.Key;
+ LocalInfo vi = (LocalInfo)
de.Value;
+ Type variable_type =
vi.VariableType;
- if (vi.VariableType ==
null)
- continue;
+ if (variable_type == null)
+ continue;
- Type variable_type =
vi.VariableType;
-
- if
(variable_type.IsPointer) {
- //
- // Am not
really convinced that this test is required (Microsoft does it)
- // but the fact
is that you would not be able to use the pointer variable
- // *anyways*
- //
- if
(!TypeManager.VerifyUnManaged (TypeManager.GetElementType (variable_type),
-
vi.Location))
-
continue;
- }
-
- if (constants == null)
+ if (variable_type.IsPointer) {
+ //
+ // Am not really
convinced that this test is required (Microsoft does it)
+ // but the fact is that
you would not be able to use the pointer variable
+ // *anyways*
+ //
+ if
(!TypeManager.VerifyUnManaged (TypeManager.GetElementType (variable_type),
+
vi.Location))
continue;
+ }
- Expression cv =
(Expression) constants [name];
- if (cv == null)
- continue;
+ if (constants == null)
+ continue;
- // Don't let 'const int
Foo = Foo;' succeed.
- // Removing the name
from 'constants' ensures that we get a LocalVariableReference below,
- // which in turn causes
the 'must be constant' error to be triggered.
- constants.Remove (name);
+ Expression cv = (Expression)
constants [name];
+ if (cv == null)
+ continue;
+ // Don't let 'const int Foo =
Foo;' succeed.
+ // Removing the name from
'constants' ensures that we get a LocalVariableReference below,
+ // which in turn causes the
'must be constant' error to be triggered.
+ constants.Remove (name);
+
+ using (ec.WithCheckState
(ec.CheckState, (flags & Flags.Unchecked) == 0)) {
ec.CurrentBlock = this;
Expression e =
cv.Resolve (ec);
if (e == null)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches
