2008-12-17 Jb Evain <jbevain@novell.com>
authorJb Evain <jbevain@gmail.com>
Wed, 17 Dec 2008 09:56:14 +0000 (09:56 -0000)
committerJb Evain <jbevain@gmail.com>
Wed, 17 Dec 2008 09:56:14 +0000 (09:56 -0000)
* mono-api-info.cs: don't add Finalizers to the api definition.

svn path=/trunk/mcs/; revision=121669

mcs/tools/corcompare/ChangeLog
mcs/tools/corcompare/mono-api-info.cs

index 1834522b5ac84f059d485b71f17ab0abecf7c700..0740ae7313baddf7fa52aab7b7d5af1f10a97f63 100644 (file)
@@ -1,3 +1,7 @@
+2008-12-17  Jb Evain  <jbevain@novell.com>
+
+       * mono-api-info.cs: don't add Finalizers to the api definition.
+
 2008-12-08  Jb Evain  <jbevain@novell.com>
 
        * Util.cs
 2003-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * CorCompare.exe.sources: not needed now.
-       
+
        * Makefile: updated to build the 3 exes we have now.
 
        * mono-api-info.cs: new program. Given an assembly name, it generates
index 604b054578de9f33271280db924690fe1fcd2c61..cc18c874a1e7f2439723b02d29c2351a80c8ffe1 100644 (file)
@@ -532,12 +532,29 @@ namespace CorCompare
                                if (!MustDocumentMethod(method))
                                        continue;
 
+                               if (IsFinalizer (method))
+                                       continue;
+
                                list.Add (method);
                        }
 
                        return (MethodDefinition []) list.ToArray (typeof (MethodDefinition));
                }
 
+               static bool IsFinalizer (MethodDefinition method)
+               {
+                       if (method.Name != "Finalize")
+                               return false;
+
+                       if (!method.IsVirtual)
+                               return false;
+
+                       if (method.Parameters.Count != 0)
+                               return false;
+
+                       return true;
+               }
+
                private MethodDefinition [] GetConstructors (TypeDefinition type)
                {
                        ArrayList list = new ArrayList ();