X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FPEAPI%2FMetadata.cs;h=eca297380bcdc92386e6067a43e5b686447f67dd;hb=098f6e8aa8ead1a80b751fa34e5e049439c2f0c3;hp=f0dd7de317628960b1bb60006b4ac29192220516;hpb=eaa4d8c4406723920e4957a62aa388dd4f31bd4a;p=mono.git
diff --git a/mcs/class/PEAPI/Metadata.cs b/mcs/class/PEAPI/Metadata.cs
index f0dd7de3176..eca297380bc 100644
--- a/mcs/class/PEAPI/Metadata.cs
+++ b/mcs/class/PEAPI/Metadata.cs
@@ -92,7 +92,14 @@ namespace PEAPI {
///
public enum ImplAttr { IL, Native, Runtime = 0x03, Unmanaged = 0x04,
ForwardRef = 0x10, PreserveSig = 0x0080, InternalCall = 0x1000,
- Synchronised = 0x0020, Synchronized = 0x0020, NoInLining = 0x0008, Optil = 0x0002}
+ Synchronised = 0x0020, Synchronized = 0x0020, NoInLining = 0x0008, NoOptimization = 0x0040, Optil = 0x0002,
+ AggressiveInlining = 0x0100
+ }
+
+ ///
+ /// Storage location for initial field data
+ ///
+ public enum DataSegment { Data, TLS, CIL }
///
/// Modes for a parameter
@@ -1634,6 +1641,7 @@ namespace PEAPI {
public class ClassDef : Class {
Class superType;
+ bool setSuperType;
ArrayList fields = new ArrayList();
ArrayList methods = new ArrayList();
ArrayList events;
@@ -1649,9 +1657,6 @@ namespace PEAPI {
MetaData md) : base(nsName, name, md)
{
metaData = md;
- if (! ((nsName == "" && name == "") || (nsName == "System" && name == "Object")) ) {
- superType = metaData.mscorlib.GetSpecialSystemClass(PrimitiveType.Object);
- }
flags = (uint)attrSet;
tabIx = MDTable.TypeDef;
}
@@ -1659,6 +1664,7 @@ namespace PEAPI {
internal void SetSuper(Class sClass)
{
superType = sClass;
+ setSuperType = true;
if (! (sClass is GenericTypeInst))
typeIndexChecked = false;
}
@@ -1670,12 +1676,13 @@ namespace PEAPI {
else
superType = metaData.mscorlib.ValueType();
+ setSuperType = true;
typeIndex = PrimitiveType.ValueType.GetTypeIndex ();
}
public void SpecialNoSuper()
{
- superType = null;
+ setSuperType = true;
}
///
@@ -1917,8 +1924,13 @@ namespace PEAPI {
internal sealed override void BuildTables(MetaData md)
{
- if (done) return;
- if ((flags & (uint)TypeAttr.Interface) != 0) { superType = null; }
+ if (done)
+ return;
+
+ if ((flags & (uint)TypeAttr.Interface) != 0) {
+ superType = null;
+ setSuperType = true;
+ }
// Console.WriteLine("Building tables for " + name);
if (layout != null) md.AddToTable(MDTable.ClassLayout,layout);
// Console.WriteLine("adding methods " + methods.Count);
@@ -1951,6 +1963,10 @@ namespace PEAPI {
((Property)properties[0]).Row,MDTable.Property));
}
// Console.WriteLine("End of building tables");
+
+ if (!setSuperType)
+ superType = metaData.mscorlib.GetSpecialSystemClass(PrimitiveType.Object);
+
done = true;
}
@@ -5045,7 +5061,7 @@ namespace PEAPI {
private byte heapSizes = 0;
MetaDataElement entryPoint;
BinaryWriter output;
- public MSCorLib mscorlib;
+ MSCorLib _mscorlib;
private TypeSpec[] systemTypeSpecs = new TypeSpec[PrimitiveType.NumSystemTypes];
long mdStart;
private ArrayList cattr_list;
@@ -5070,9 +5086,15 @@ namespace PEAPI {
for (int i=0; i < lgeCIx.Length; i++) {
lgeCIx[i] = false;
}
- mscorlib = new MSCorLib(this);
}
+ public MSCorLib mscorlib {
+ get {
+ return _mscorlib ?? (_mscorlib = new MSCorLib (this));
+ }
+ }
+
+
internal TypeSpec GetPrimitiveTypeSpec(int ix)
{
return systemTypeSpecs[ix];