X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fmcs%2Fmodifiers.cs;h=61ff6e47de8348ef791e9cac0928521f87b48389;hb=5c7308bc4df12e9e19e07ec6518b2db1ae80ff86;hp=0a1ddbb52e19cec6ae57df28756a3bc34c37e5a3;hpb=85a683a1f01e4ac9c6dbbbd86185295ad2719d42;p=mono.git diff --git a/mcs/mcs/modifiers.cs b/mcs/mcs/modifiers.cs index 0a1ddbb52e1..61ff6e47de8 100644 --- a/mcs/mcs/modifiers.cs +++ b/mcs/mcs/modifiers.cs @@ -25,20 +25,19 @@ namespace Mono.CSharp { public const int EXTERN = 0x0800; public const int VOLATILE = 0x1000; public const int UNSAFE = 0x2000; - private const int TOP = 0x2000; + private const int TOP = 0x4000; public const int PROPERTY_CUSTOM = 0x4000; // Custom property modifier // - // We use this internally to flag that the method contains an iterator + // Compiler specific flags // - public const int METHOD_YIELDS = 0x8000; - public const int METHOD_GENERIC = 0x10000; public const int PARTIAL = 0x20000; public const int DEFAULT_ACCESS_MODIFER = 0x40000; public const int METHOD_EXTENSION = 0x80000; public const int COMPILER_GENERATED = 0x100000; - public const int BACKING_FIELD = 0x200000 | COMPILER_GENERATED; + public const int BACKING_FIELD = 0x200000; + public const int DEBUGGER_HIDDEN = 0x400000; public const int Accessibility = PUBLIC | PROTECTED | INTERNAL | PRIVATE; @@ -85,19 +84,21 @@ namespace Mono.CSharp { public static string GetDescription (MethodAttributes ma) { - if ((ma & MethodAttributes.Assembly) != 0) + ma &= MethodAttributes.MemberAccessMask; + + if (ma == MethodAttributes.Assembly) return "internal"; - if ((ma & MethodAttributes.Family) != 0) + if (ma == MethodAttributes.Family) return "protected"; - if ((ma & MethodAttributes.Public) != 0) + if (ma == MethodAttributes.Public) return "public"; - if ((ma & MethodAttributes.FamANDAssem) != 0) + if (ma == MethodAttributes.FamORAssem) return "protected internal"; - if ((ma & MethodAttributes.Private) != 0) + if (ma == MethodAttributes.Private) return "private"; throw new NotImplementedException (ma.ToString ()); @@ -109,20 +110,20 @@ namespace Mono.CSharp { if (is_toplevel){ if ((mod_flags & PUBLIC) != 0) - t |= TypeAttributes.Public; - if ((mod_flags & PRIVATE) != 0) - t |= TypeAttributes.NotPublic; + t = TypeAttributes.Public; + else if ((mod_flags & PRIVATE) != 0) + t = TypeAttributes.NotPublic; } else { if ((mod_flags & PUBLIC) != 0) - t |= TypeAttributes.NestedPublic; - if ((mod_flags & PRIVATE) != 0) - t |= TypeAttributes.NestedPrivate; - if ((mod_flags & PROTECTED) != 0 && (mod_flags & INTERNAL) != 0) - t |= TypeAttributes.NestedFamORAssem; - if ((mod_flags & PROTECTED) != 0) - t |= TypeAttributes.NestedFamily; - if ((mod_flags & INTERNAL) != 0) - t |= TypeAttributes.NestedAssembly; + t = TypeAttributes.NestedPublic; + else if ((mod_flags & PRIVATE) != 0) + t = TypeAttributes.NestedPrivate; + else if ((mod_flags & (PROTECTED | INTERNAL)) == (PROTECTED | INTERNAL)) + t = TypeAttributes.NestedFamORAssem; + else if ((mod_flags & PROTECTED) != 0) + t = TypeAttributes.NestedFamily; + else if ((mod_flags & INTERNAL) != 0) + t = TypeAttributes.NestedAssembly; } if ((mod_flags & SEALED) != 0) @@ -165,9 +166,9 @@ namespace Mono.CSharp { if ((mod_flags & PUBLIC) != 0) ma |= MethodAttributes.Public; - if ((mod_flags & PRIVATE) != 0) + else if ((mod_flags & PRIVATE) != 0) ma |= MethodAttributes.Private; - if ((mod_flags & PROTECTED) != 0){ + else if ((mod_flags & PROTECTED) != 0){ if ((mod_flags & INTERNAL) != 0) ma |= MethodAttributes.FamORAssem; else