AppModel/C++: Unused concrete value types were not included
This commit is contained in:
@@ -252,6 +252,17 @@ namespace Il2CppInspector.Model
|
||||
}
|
||||
}
|
||||
|
||||
// Find unused concrete value types
|
||||
var usedTypes = Types.Values.Select(t => t.Type);
|
||||
var unusedTypes = TypeModel.Types.Except(usedTypes);
|
||||
var unusedValueTypes = unusedTypes.Where(t => t.IsValueType && !t.IsGenericType && !t.IsGenericParameter);
|
||||
|
||||
Group = "unused_value_types";
|
||||
|
||||
foreach (var type in unusedValueTypes)
|
||||
declarationGenerator.IncludeType(type);
|
||||
AddTypes(declarationGenerator.GenerateRemainingTypeDeclarations());
|
||||
|
||||
// Restore stdout
|
||||
Console.SetOut(stdout);
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ typedef size_t uintptr_t;
|
||||
writeTypesForGroup("Application types from method calls", "types_from_methods");
|
||||
writeTypesForGroup("Application types from generic methods", "types_from_generic_methods");
|
||||
writeTypesForGroup("Application types from usages", "types_from_usages");
|
||||
writeTypesForGroup("Application unused value types", "unused_value_types");
|
||||
|
||||
writeCode("#if !defined(_GHIDRA_) && !defined(_IDA_)");
|
||||
writeCode("}");
|
||||
|
||||
Reference in New Issue
Block a user