// (C) 2004 Novell, Inc.
//
-#if !DEBUG
- #define PRODUCTION
-#endif
+//
+// Please leave this defined on SVN: The idea is that when we ship the
+// compiler to end users, if the compiler crashes, they have a chance
+// to narrow down the problem.
+//
+// Only remove it if you need to debug locally on your tree.
+//
+//#define PRODUCTION
using System;
using System.IO;
Emitting
}
+ public static EmitContext TempEc;
+
bool isAnonymousMethodAllowed = true;
Phase current_phase;
public AssemblyBuilder Builder;
bool is_cls_compliant;
bool wrap_non_exception_throws;
+ bool has_extension_method;
public Attribute ClsCompliantAttribute;
public AssemblyClass (): base ()
{
+#if GMCS_SOURCE
wrap_non_exception_throws = true;
+#endif
+ }
+
+ public bool HasExtensionMethods {
+ set { has_extension_method = value; }
}
public bool IsClsCompliant {
return;
}
+ if (a.Type == TypeManager.extension_attribute_type) {
+ a.Error_MisusedExtensionAttribute ();
+ return;
+ }
#endif
Builder.SetCustomAttribute (customBuilder);
}
base.Emit (tc);
#if GMCS_SOURCE
+ if (has_extension_method)
+ Builder.SetCustomAttribute (TypeManager.extension_attribute_attr);
+
// FIXME: Does this belong inside SRE.AssemblyBuilder instead?
if (OptAttributes == null || !OptAttributes.Contains (TypeManager.runtime_compatibility_attr_type)) {
ConstructorInfo ci = TypeManager.GetConstructor (
// TODO: make it private and move all builder based methods here
public ModuleBuilder Builder;
bool m_module_is_unsafe;
+ bool has_default_charset;
public CharSet DefaultCharSet = CharSet.Ansi;
public TypeAttributes DefaultCharSetType = TypeAttributes.AnsiClass;
Builder.SetCustomAttribute (customBuilder);
}
+ public bool HasDefaultCharSet {
+ get {
+ return has_default_charset;
+ }
+ }
+
/// <summary>
/// It is called very early therefore can resolve only predefined attributes
/// </summary>
Attribute a = ResolveAttribute (TypeManager.default_charset_type);
if (a != null) {
+ has_default_charset = true;
DefaultCharSet = a.GetCharSetValue ();
switch (DefaultCharSet) {
case CharSet.Ansi: