projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
2009-03-27 Marek Safar <marek.safar@gmail.com>
[mono.git]
/
mcs
/
mcs
/
rootcontext.cs
diff --git
a/mcs/mcs/rootcontext.cs
b/mcs/mcs/rootcontext.cs
index 5962a33ee5f2dd7b86bb6cea94b5e1cbc0d4033b..e6c2c4b2f1dc5ea543ad89cab34d2add27f13dc4 100644
(file)
--- a/
mcs/mcs/rootcontext.cs
+++ b/
mcs/mcs/rootcontext.cs
@@
-102,7
+102,7
@@
namespace Mono.CSharp {
//
// Contains the parsed tree
//
//
// Contains the parsed tree
//
- static
RootTypes
root;
+ static
ModuleContainer
root;
//
// This hashtable contains all of the #definitions across the source code
//
// This hashtable contains all of the #definitions across the source code
@@
-145,7
+145,7
@@
namespace Mono.CSharp {
public static void Reset (bool full)
{
if (full)
public static void Reset (bool full)
{
if (full)
- root = n
ew RootTypes ()
;
+ root = n
ull
;
type_container_resolve_order = new ArrayList ();
EntryPoint = null;
type_container_resolve_order = new ArrayList ();
EntryPoint = null;
@@
-167,8
+167,8
@@
namespace Mono.CSharp {
//
// Setup default defines
//
//
// Setup default defines
//
-
RootContext.
AllDefines = new ArrayList ();
-
RootContext.
AddConditional ("__MonoCS__");
+ AllDefines = new ArrayList ();
+ AddConditional ("__MonoCS__");
}
public static void AddConditional (string p)
}
public static void AddConditional (string p)
@@
-183,8
+183,9
@@
namespace Mono.CSharp {
return AllDefines.Contains (value);
}
return AllDefines.Contains (value);
}
- static public
RootTypes
ToplevelTypes {
+ static public
ModuleContainer
ToplevelTypes {
get { return root; }
get { return root; }
+ set { root = value; }
}
public static void RegisterOrder (TypeContainer tc)
}
public static void RegisterOrder (TypeContainer tc)
@@
-201,6
+202,8
@@
namespace Mono.CSharp {
// </remarks>
static public void ResolveTree ()
{
// </remarks>
static public void ResolveTree ()
{
+ root.Resolve ();
+
//
// Interfaces are processed next, as classes and
// structs might inherit from an object or implement
//
// Interfaces are processed next, as classes and
// structs might inherit from an object or implement
@@
-257,9
+260,7
@@
namespace Mono.CSharp {
//
if (helper_classes != null){
foreach (TypeBuilder type_builder in helper_classes) {
//
if (helper_classes != null){
foreach (TypeBuilder type_builder in helper_classes) {
-#if GMCS_SOURCE
- type_builder.SetCustomAttribute (TypeManager.GetCompilerGeneratedAttribute (Location.Null));
-#endif
+ PredefinedAttributes.Get.CompilerGenerated.EmitAttribute (type_builder);
type_builder.CreateType ();
}
}
type_builder.CreateType ();
}
}
@@
-312,8
+313,13
@@
namespace Mono.CSharp {
if (type_container_resolve_order != null){
foreach (TypeContainer tc in type_container_resolve_order)
tc.ResolveType ();
if (type_container_resolve_order != null){
foreach (TypeContainer tc in type_container_resolve_order)
tc.ResolveType ();
- foreach (TypeContainer tc in type_container_resolve_order)
- tc.Define ();
+ foreach (TypeContainer tc in type_container_resolve_order) {
+ try {
+ tc.Define ();
+ } catch (Exception e) {
+ throw new InternalErrorException (tc, e);
+ }
+ }
}
ArrayList delegates = root.Delegates;
}
ArrayList delegates = root.Delegates;
@@
-351,7
+357,7
@@
namespace Mono.CSharp {
}
CodeGen.Assembly.Emit (root);
}
CodeGen.Assembly.Emit (root);
-
CodeGen.Module.Emit (root
);
+
root.Emit (
);
}
//
}
//
@@
-384,7
+390,7
@@
namespace Mono.CSharp {
FieldBuilder fb;
if (impl_details_class == null){
FieldBuilder fb;
if (impl_details_class == null){
- impl_details_class =
CodeGen.Module
.Builder.DefineType (
+ impl_details_class =
ToplevelTypes
.Builder.DefineType (
"<PrivateImplementationDetails>",
TypeAttributes.NotPublic,
TypeManager.object_type);
"<PrivateImplementationDetails>",
TypeAttributes.NotPublic,
TypeManager.object_type);