[mono-api-info] Add an is-override attribute to determine if a method is overriding...
[mono.git] / mcs / tools / corcompare / mono-api-info.cs
index f9189a2ce80bf193d39b3e676fcf64028db18330..8b1ad945095c64d208ea0ce2d8626209b6c68709 100644 (file)
@@ -1010,6 +1010,15 @@ namespace CorCompare
                                AddAttribute ("sealed", "true");
                        if (mbase.IsStatic)
                                AddAttribute ("static", "true");
+                       var baseMethod = TypeHelper.GetBaseMethodInTypeHierarchy (mbase);
+                       if (baseMethod != null && baseMethod != mbase) {
+                               // This indicates whether this method is an override of another method.
+                               // This information is not necessarily available in the api info for any
+                               // particular assembly, because a method is only overriding another if
+                               // there is a base virtual function with the same signature, and that
+                               // base method can come from another assembly.
+                               AddAttribute ("is-override", "true");
+                       }
                        string rettype = Utils.CleanupTypeName (mbase.MethodReturnType.ReturnType);
                        if (rettype != "System.Void" || !mbase.IsConstructor)
                                AddAttribute ("returntype", (rettype));