Skip to content

Commit

Permalink
Plug 'isGenericType' in importer
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio0694 committed Mar 11, 2024
1 parent dd1152e commit 95c36b3
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions src/coreclr/jit/importercalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3537,25 +3537,7 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis,
}
break;
case NI_System_Type_get_IsGenericType:
// a type is a generic type if there is at least one type argument that is
// some valid type, so we can always just check the one at index 0 for this.
// This will work on open generic types as well, and the returned type handle
// will be some handle that represents the (non constructed) type parameter.
if (info.compCompHnd->getTypeInstantiationArgument(hClass, 0) != NO_CLASS_HANDLE)
{
retNode = gtNewTrue();
}
else if ((info.compCompHnd->getClassAttribs(hClass) & CORINFO_FLG_SHAREDINST) != 0)
{
// if we have no type arguments, check that the type itself is not __Canon, and
// simply skip expanding the intrinsic in that case, rather than incorrectly
// hardcoding 'false' as the resulting expression.
retNode = nullptr;
}
else
{
retNode = gtNewFalse();
}
retNode = info.compCompHnd->isGenericType(hClass) ? gtNewTrue() : gtNewFalse();
break;

default:
Expand Down

0 comments on commit 95c36b3

Please sign in to comment.