146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
if( cfg->currentBB() && !cfg->currentBB()->terminator() )
{
p.flushValue();
cb->destroyAllLiveValues( c );
if( returnType == GetValueType< void >() )
cfg->emitTerminator( r->currentLocation(), cir::RetVoid() );
else if( !defRetVal )
{
dm.emitSyntaxErrorMessage( r->currentLocation(), "missing return statement." );
return nullptr;
}
else
{
|
|
|
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
if( cfg->currentBB() && !cfg->currentBB()->terminator() )
{
p.flushValue();
cb->destroyAllLiveValues( c );
if( returnType == GetValueType< void >() )
cfg->emitTerminator( r->currentLocation(), cir::RetVoid( r->currentLocation() ) );
else if( !defRetVal )
{
dm.emitSyntaxErrorMessage( r->currentLocation(), "missing return statement." );
return nullptr;
}
else
{
|
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
break;
}
return nullptr;
}
cfg->currentBB()->append( get< Value >( converted ) );
cfg->emitTerminator( r->currentLocation(), cir::Ret() );
}
}
// TODO_REENABLE_VERIFY
/* verify::Func fv( c, cfg, returnType );
if( !fv.verify() )
return nullptr;*/
return cfg;
}
}
|
|
|
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
break;
}
return nullptr;
}
cfg->currentBB()->append( get< Value >( converted ) );
cfg->emitTerminator( r->currentLocation(), cir::Ret( r->currentLocation() ) );
}
}
// TODO_REENABLE_VERIFY
/* verify::Func fv( c, cfg, returnType );
if( !fv.verify() )
return nullptr;*/
return cfg;
}
}
|