128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
if( CheckParamListKind( params ) != ParamListKind::Regular )
{
DiagnosticsManager::GetInstance().emitErrorMessage( params.locationId(),
"#CompileFileToFunction: template parameter lists are not supported.", 0 );
return PoisonValue();
}
auto ftype = BuildFuncType( sema::DomainAny(), rt, params );
// TODO at some point we'll want to pass the base identity to use as a param but
// let's wait and see how the module and namespace stuff pans out first
auto identity = sema::InjectDomainIntoIdentity( builtins::RootIdentity(), DomainRunTime() );
sema::Context c( pEnv.lock(), identity, ftype.returnType() );
auto funcIdentity = AppendToVectorTerm( sema::InjectDomainIntoIdentity( identity, DomainRunTime() ),
TERM( StringId( pEnv.lock()->NewUniqueId() ) ) );
c.env()->addVisibilityRule(
InjectDomainIntoIdentity( identity, ANYTERM( _ ) ),
InjectDomainIntoIdentity( funcIdentity, ANYTERM( _ ) ) );
|
<
<
<
|
>
|
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
if( CheckParamListKind( params ) != ParamListKind::Regular )
{
DiagnosticsManager::GetInstance().emitErrorMessage( params.locationId(),
"#CompileFileToFunction: template parameter lists are not supported.", 0 );
return PoisonValue();
}
// TODO at some point we'll want to pass the base identity to use as a param but
// let's wait and see how the module and namespace stuff pans out first
auto identity = sema::InjectDomainIntoIdentity( builtins::RootIdentity(), DomainRunTime() );
sema::Context c( pEnv.lock(), identity, ValueToIRExpr( rt ) );
auto ftype = BuildFuncType( c, sema::DomainAny(), rt, params );
auto funcIdentity = AppendToVectorTerm( sema::InjectDomainIntoIdentity( identity, DomainRunTime() ),
TERM( StringId( pEnv.lock()->NewUniqueId() ) ) );
c.env()->addVisibilityRule(
InjectDomainIntoIdentity( identity, ANYTERM( _ ) ),
InjectDomainIntoIdentity( funcIdentity, ANYTERM( _ ) ) );
|