35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
if( !typeVal.isType() )
typeVal = ToType( c, typeVal );
if( !ParseTypePredicates( c, typeVal ) )
return PoisonValue();
LocalVar lv( name, ValueToEIR( typeVal ), index );
bb->append( AllocVar( typeVal, index ) );
Value initResult;
{
DiagnosticsContext dc( 0, "When invoking Initialize." );
if( initializer )
|
|
|
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
if( !typeVal.isType() )
typeVal = ToType( c, typeVal );
if( !ParseTypePredicates( c, typeVal ) )
return PoisonValue();
LocalVar lv( name, ValueToEIR( typeVal ), index );
bb->append( AllocVar( typeVal, index, locId ) );
Value initResult;
{
DiagnosticsContext dc( 0, "When invoking Initialize." );
if( initializer )
|
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
// Retrieve the texpr's location and set it on the inferred type. This way if an
// error occurs later with it, for instance when calling LowerTypeForRuntime on it during codegen,
// it will have a meaningful location for the error message to attach itself on.
auto typeLoc = EIRToValue( typeTExpr )->locationId();
LocalVar lv( name, type, index );
bb->append( AllocVar( EIRToValue( lv.type() )->setLocationId( typeLoc ), index ) );
DiagnosticsContext dc( 0, "When invoking Initialize." );
auto initResult = InvokeOverloadSet( c,
c.env()->extInitialize(),
MakeTuple( ToValue( lv ).setLocationId( locId ), initVal ) );
|
|
|
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
// Retrieve the texpr's location and set it on the inferred type. This way if an
// error occurs later with it, for instance when calling LowerTypeForRuntime on it during codegen,
// it will have a meaningful location for the error message to attach itself on.
auto typeLoc = EIRToValue( typeTExpr )->locationId();
LocalVar lv( name, type, index );
bb->append( AllocVar( EIRToValue( lv.type() )->setLocationId( typeLoc ), index, locId ) );
DiagnosticsContext dc( 0, "When invoking Initialize." );
auto initResult = InvokeOverloadSet( c,
c.env()->extInitialize(),
MakeTuple( ToValue( lv ).setLocationId( locId ), initVal ) );
|