30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
+
+
+
|
auto bb = cfg->currentBB();
if( !bb )
return PoisonValue();
Value typeVal = *ValueFromEIR( type );
if( !typeVal.isType() )
typeVal = ToType( c, typeVal );
if( !ParseTypePredicates( c, c.identity(), typeVal ) )
return PoisonValue();
LocalVar lv( name, ValueToEIR( typeVal ), index );
bb->emplace_back( AllocVar( typeVal, index ) );
Value initResult;
{
|
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
-
+
+
+
|
Vec(
SubTerm(), // locvar
SubTerm() // initializer
)
);
auto&& [type, initializer] = *callDecomp;
auto initializerVal = *ValueFromEIR( initializer );
if( !ParseTypePredicates( c, c.identity(), *ValueFromEIR( type ) ) )
return PoisonValue();
auto index = cfg->getNewTemporaryIndex();
// 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.
uint32_t typeLoc = ValueFromEIR( typeTExpr )->locationId();
|