39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
-
+
-
+
|
auto index = util::GenerateNewUID();
LocalVar lv( name, ValueToEIR( typeVal ), index );
bb->append( AllocVar( typeVal, index, locId ) );
Value initResult;
{
DiagnosticsContext dc( 0, "When invoking Initialize." );
DiagnosticsContext dc( 0, "When invoking _Initialize." );
if( initializer )
{
initResult = InvokeOverloadSet( c,
c.env()->extInitialize(),
MakeClosedTuple( ToValue( lv ).setLocationId( locId ), *initializer ), locId );
}
else
{
initResult = InvokeOverloadSet( c,
c.env()->extInitialize(),
MakeClosedTuple( ToValue( lv ).setLocationId( locId ) ), locId );
}
}
if( !initResult.isPoison() )
{
DiagnosticsContext dc2( initResult.locationId(), "When invoking DropValue." );
DiagnosticsContext dc2( initResult.locationId(), "When invoking _DropValue." );
InvokeOverloadSet( c, c.env()->extDropValue(),
MakeClosedTuple( c.builder(), move( initResult ) ), initResult.locationId() );
}
auto locVar = ToValue( lv );
auto identity = AppendToVectorTerm( c.identity(), name );
|
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
-
+
-
+
|
// 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.
LocalVar lv( name, ValueToEIR( type ), index );
bb->append( AllocVar( type, index, locId ) );
DiagnosticsContext dc( 0, "When invoking Initialize." );
DiagnosticsContext dc( 0, "When invoking _Initialize." );
auto initResult = InvokeOverloadSet( c,
c.env()->extInitialize(),
MakeClosedTuple( ToValue( lv ).setLocationId( locId ), initVal ) );
if( !initResult.isPoison() )
{
DiagnosticsContext dc2( initResult.locationId(), "When invoking DropValue." );
DiagnosticsContext dc2( initResult.locationId(), "When invoking _DropValue." );
InvokeOverloadSet( c, c.env()->extDropValue(),
MakeClosedTuple( c.builder(), move( initResult ) ) );
}
auto locVar = ToValue( lv );
if( name != ""_sid )
|