52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
-
+
-
+
|
auto typeCheckedArgs = DropVectorTerm( typeCheckedCallPat, 1 );
newCallee.setLocationId( loc );
if( IsBuiltinFunc( newCallee ) )
return BuildComputedValue( typeCheckedRType, cir::Call( newCallee, move( typeCheckedArgs ) ) );
if( IsIntrinsicFunc( newCallee ) )
if( IsBuiltinIntrinsicFunc( newCallee ) )
return GetBuiltinIntrinsicFuncWrapper( newCallee )( c, move( typeCheckedArgs ) );
auto ft = *FromValue< FuncType >( *ValueFromEIR( newCallee.type() ) );
auto argList = BuildArgListForCall( c, ft, typeCheckedArgs );
if( !argList )
return PoisonValue();
return BuildComputedValue( typeCheckedRType, cir::Call( newCallee, move( *argList ) ) );
}
optional< Term > getSignature( const Value& callee ) const final
{
return GetFuncSig( callee );
}
Value prepareFunc( const Context& c, uint32_t funcValLocation, const Value& callee, const Term& typeCheckedCallPat, TypeCheckingContext& tcc ) const final
{
if( IsBuiltinFunc( callee ) || IsIntrinsicFunc( callee ) )
if( IsBuiltinFunc( callee ) || IsBuiltinIntrinsicFunc( callee ) )
return callee;
// TODO better description with the function's name if possible (we may need to explicitely store it in the func)
DiagnosticsContext dc( 0, true );
VerbosityContext vc( Verbosity::Normal, true );
return CompileFunc( c, callee );
|