[swift-dev] Create SILType from GenericTypeParamType
spestov at apple.com
Mon Dec 11 16:40:19 CST 2017
There are two things that need to happen here, first the generic type parameter needs to be substituted with a concrete type, then it needs to be “lowered” to a SIL type.
You can try something like this,
GenericTypeParamType *paramTy = …;
SILFunction *F = …;
SILType T = F->getModule().Types.getLoweredType(F->mapTypeIntoContext(paramTy));
But we would need more details to understand what you’re doing.
> On Dec 11, 2017, at 2:30 PM, Raj Barik via swift-dev <swift-dev at swift.org> wrote:
> I am trying to create a new generic function in the Swift compiler (as part of a pass). Although I am able to create the generic function signature fairly easily, I do not find an easy way to create a SILType from a GenericTypeParamType, which is needed to be passed to createFunctionArgument. Any help/suggestion?
> swift-dev mailing list
> swift-dev at swift.org
More information about the swift-dev