Merge pull request #2528 from vargaz/jit-errors2
[mono.git] / mcs / mcs / modifiers.cs
index fedfe6e55eee56e3bd519c4cb852c68a49e57a14..bfae5985a0345f1d5058e6e6586618d0fd185ba1 100644 (file)
@@ -1,8 +1,22 @@
 //
-// modifiers.cs: Modifier handling.
-// 
+// modifiers.cs: Modifiers handling
+//
+// Authors: Miguel de Icaza (miguel@gnu.org)
+//          Marek Safar (marek.safar@gmail.com)
+//
+// Dual licensed under the terms of the MIT X11 or GNU GPL
+//
+// Copyright 2001, 2002, 2003 Ximian, Inc (http://www.ximian.com)
+// Copyright 2004-2010 Novell, Inc
+//
+
 using System;
+
+#if STATIC
+using IKVM.Reflection;
+#else
 using System.Reflection;
+#endif
 
 namespace Mono.CSharp
 {
@@ -23,20 +37,22 @@ namespace Mono.CSharp
                EXTERN    = 0x0800,
                VOLATILE  = 0x1000,
                UNSAFE    = 0x2000,
-               TOP       = 0x4000,
+               ASYNC     = 0x4000,
+               TOP       = 0x8000,
 
                //
                // Compiler specific flags
                //
-               PROPERTY_CUSTOM                 = 0x4000,
+               PROPERTY_CUSTOM                 = 0x10000,
 
-               ASYNC                                   = 0x10000,
                PARTIAL                                 = 0x20000,
-               DEFAULT_ACCESS_MODIFER  = 0x40000,
+               DEFAULT_ACCESS_MODIFIER = 0x40000,
                METHOD_EXTENSION                = 0x80000,
                COMPILER_GENERATED              = 0x100000,
                BACKING_FIELD                   = 0x200000,
                DEBUGGER_HIDDEN                 = 0x400000,
+               DEBUGGER_STEP_THROUGH   = 0x800000,
+               AutoProperty                    = 0x1000000,
 
                AccessibilityMask = PUBLIC | PROTECTED | INTERNAL | PRIVATE,
                AllowedExplicitImplFlags = UNSAFE | EXTERN,
@@ -95,6 +111,8 @@ namespace Mono.CSharp
                                s = "volatile"; break;
                        case Modifiers.UNSAFE:
                                s = "unsafe"; break;
+                       case Modifiers.ASYNC:
+                               s = "async"; break;
                        }
 
                        return s;
@@ -239,14 +257,14 @@ namespace Mono.CSharp
                                if ((mod & Modifiers.AccessibilityMask) == 0) {
                                        mod |= def_access;
                                        if (def_access != 0)
-                                               mod |= Modifiers.DEFAULT_ACCESS_MODIFER;
+                                               mod |= Modifiers.DEFAULT_ACCESS_MODIFIER;
                                        return mod;
                                }
 
                                return mod;
                        }
 
-                       for (i = 1; i <= (int) Modifiers.TOP; i <<= 1) {
+                       for (i = 1; i < (int) Modifiers.TOP; i <<= 1) {
                                if ((i & invalid_flags) == 0)
                                        continue;