diff options
author | jfrijters <jfrijters> | 2011-03-08 10:47:45 +0300 |
---|---|---|
committer | jfrijters <jfrijters> | 2011-03-08 10:47:45 +0300 |
commit | 3ee54261f7b120b6482dbabb9e66ab4bd0cc63ab (patch) | |
tree | eeddc34693984c7bacb2e84e6c60c1aa66cb9c3d /reflect/Emit | |
parent | 602e60e74cf5bf23fe71a9cb710a853ba932de12 (diff) |
Added API extension Module.__GetReferencedTypes() to get the TypeRef table contents.
Diffstat (limited to 'reflect/Emit')
-rw-r--r-- | reflect/Emit/ModuleBuilder.cs | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/reflect/Emit/ModuleBuilder.cs b/reflect/Emit/ModuleBuilder.cs index 4c268225..a25c9cd6 100644 --- a/reflect/Emit/ModuleBuilder.cs +++ b/reflect/Emit/ModuleBuilder.cs @@ -386,11 +386,6 @@ namespace IKVM.Reflection.Emit bb.WriteCompressedInt(list.Count); foreach (CustomAttributeBuilder cab in list) { - if (cab.Constructor.Module != this) - { - // to make ildasm show the type properly, we need to have a TypeRef to the type - ImportType(cab.Constructor.DeclaringType); - } bb.Write(cab.Constructor.DeclaringType.AssemblyQualifiedName); namedArgs.Clear(); cab.WriteNamedArgumentsForDeclSecurity(this, namedArgs); @@ -1297,6 +1292,19 @@ namespace IKVM.Reflection.Emit } return arr; } + + public override Type[] __GetReferencedTypes() + { + List<Type> list = new List<Type>(); + foreach (KeyValuePair<Type, int> kv in typeTokens) + { + if (kv.Value >> 24 == TypeRefTable.Index) + { + list.Add(kv.Key); + } + } + return list.ToArray(); + } } class ArrayMethod : MethodInfo |