Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions src/coreclr/tools/aot/crossgen2/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -668,10 +668,24 @@ private TypeDesc FindType(CompilerTypeSystemContext context, string typeName)
TypeDesc foundType = systemModule.GetTypeByCustomAttributeTypeName(typeName, false,
(module, typeDefName) => (MetadataType)module.Context.GetCanonType(typeDefName));

if (foundType == null)
throw new CommandLineException(string.Format(SR.TypeNotFound, typeName));
if (foundType != null)
return foundType;

return foundType;
// In composite mode the method we care about may be in any one of the input files, not just the system module.
if (Get(_command.Composite))
{
foreach (var searchModulePath in context.InputFilePaths.Values)
{
var searchModule = context.GetModuleFromPath(searchModulePath, true);
foundType = searchModule.GetTypeByCustomAttributeTypeName(typeName, false,
(module, typeDefName) => (MetadataType)module.Context.GetCanonType(typeDefName));

if (foundType != null)
return foundType;
}
}

throw new CommandLineException(string.Format(SR.TypeNotFound, typeName));
}

private MethodDesc CheckAndParseSingleMethodModeArguments(CompilerTypeSystemContext context)
Expand Down
Loading