private static void AddMethodImplOptions(MethodDefinition method, CustomAttribute attribute) { if (AttributesUtilities.DoesMethodHaveMethodImplOptions(method)) { V_0 = 0; if (method.get_AggressiveInlining()) { V_0 = V_0 | 0x100; } if (method.get_IsForwardRef()) { V_0 = V_0 | 16; } if (method.get_IsInternalCall()) { V_0 = V_0 | 0x1000; } if (method.get_NoInlining()) { V_0 = V_0 | 8; } if (method.get_NoOptimization()) { V_0 = V_0 | 64; } if (method.get_IsPreserveSig() && !method.get_HasPInvokeInfo()) { V_0 = V_0 | 128; } if (method.get_IsSynchronized()) { V_0 = V_0 | 32; } if (method.get_IsUnmanaged()) { V_0 = V_0 | 4; } attribute.get_ConstructorArguments().Add(AttributesUtilities.GetMethodImplAttributeArgument(method, V_0)); } return; }
private static void AddMethodCodeType(MethodDefinition method, CustomAttribute attribute) { if (method.get_IsNative() || method.get_IsOPTIL() || method.get_IsRuntime()) { V_0 = 0; if (method.get_IsNative()) { V_0 = V_0 | 1; } if (method.get_IsOPTIL()) { V_0 = V_0 | 2; } if (method.get_IsRuntime()) { V_0 = V_0 | 3; } attribute.get_Fields().Add(new CustomAttributeNamedArgument("MethodCodeType", AttributesUtilities.GetMethodImplAttributeArgument(method, V_0))); } return; }