Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnkit Jain <radical@corewars.org>2006-02-19 13:40:06 +0300
committerAnkit Jain <radical@corewars.org>2006-02-19 13:40:06 +0300
commitd720913779c2df77b49e8fba31d012c60c32eed3 (patch)
tree3fe4e1d16b2600d045fcb64ad4ebc420420408fe /mcs/class/PEAPI/Metadata.cs
parentbe9be4b36b2f0872f18368e611bd7e961170f0b1 (diff)
In ilasm/codegen:
* CodeGen.cs (CodeGen.ThisModule): New. (CodeGen.Write): Set module name if not set by '.module' directive. * Module.cs: Inherit from ExternRef. In class/PEAPI: * Metadata.cs (Module): Implment IExternRef to allow reference to types in 'this' module. svn path=/trunk/mcs/; revision=57044
Diffstat (limited to 'mcs/class/PEAPI/Metadata.cs')
-rw-r--r--mcs/class/PEAPI/Metadata.cs17
1 files changed, 16 insertions, 1 deletions
diff --git a/mcs/class/PEAPI/Metadata.cs b/mcs/class/PEAPI/Metadata.cs
index 083f8ba8fbe..86ac1099d8a 100644
--- a/mcs/class/PEAPI/Metadata.cs
+++ b/mcs/class/PEAPI/Metadata.cs
@@ -2510,7 +2510,7 @@ namespace PEAPI {
/// <summary>
/// Descriptor for THIS module
/// </summary>
- public class Module : ResolutionScope {
+ public class Module : ResolutionScope, IExternRef {
Guid mvid;
uint mvidIx = 0;
@@ -2526,6 +2526,21 @@ namespace PEAPI {
get { return mvid; }
}
+ public ClassRef AddClass(string nsName, string name)
+ {
+ ClassRef aClass = new ClassRef (nsName, name, metaData);
+ metaData.AddToTable (MDTable.TypeRef, aClass);
+ aClass.SetParent (this);
+ return aClass;
+ }
+
+ public ClassRef AddValueClass(string nsName, string name)
+ {
+ ClassRef aClass = AddClass (nsName, name);
+ aClass.MakeValueClass (ValueClass.ValueType);
+ return aClass;
+ }
+
internal sealed override uint Size(MetaData md)
{
return 2 + md.StringsIndexSize() + 3 * md.GUIDIndexSize();