Removed unused Weaver ResolveInheritanceHierarchy function

This commit is contained in:
vis2k 2018-12-31 00:10:25 +01:00
parent ea1e571ccd
commit 29f55fed48

View File

@ -78,45 +78,6 @@ public static bool ImplementsSyncObject(TypeReference typeRef)
return false; return false;
} }
public static IEnumerable<TypeReference> ResolveInheritanceHierarchy(TypeReference type)
{
// for value types the hierarchy is pre-defined as "<Self> : System.ValueType : System.Object"
if (type.IsValueType)
{
yield return type;
yield return Weaver.valueTypeType;
yield return Weaver.objectType;
yield break;
}
// resolve entire hierarchy from <Self> to System.Object
while (type != null && type.FullName != Weaver.objectType.FullName)
{
yield return type;
try
{
var typeDef = type.Resolve();
if (typeDef == null)
{
break;
}
else
{
type = typeDef.BaseType;
}
}
catch
{
// when calling type.Resolve() we can sometimes get an exception if some dependant library
// could not be loaded (for whatever reason) so just swallow it and break out of the loop
break;
}
}
yield return Weaver.objectType;
}
public static string DestinationFileFor(string outputDir, string assemblyPath) public static string DestinationFileFor(string outputDir, string assemblyPath)
{ {
var fileName = Path.GetFileName(assemblyPath); var fileName = Path.GetFileName(assemblyPath);