MCPcopy Create free account
hub / github.com/OpenMW/openmw / assignToLocal

Function assignToLocal

components/compiler/generator.cpp:303–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301 }
302
303 void assignToLocal(CodeContainer& code, char localType, int localIndex, const CodeContainer& value, char valueType)
304 {
305 opPushInt(code, localIndex);
306
307 std::copy(value.begin(), value.end(), std::back_inserter(code));
308
309 if (localType != valueType)
310 {
311 if (localType == 'f' && valueType == 'l')
312 {
313 opIntToFloat(code);
314 }
315 else if ((localType == 'l' || localType == 's') && valueType == 'f')
316 {
317 opFloatToInt(code);
318 }
319 }
320
321 switch (localType)
322 {
323 case 'f':
324
325 opStoreLocalFloat(code);
326 break;
327
328 case 's':
329
330 opStoreLocalShort(code);
331 break;
332
333 case 'l':
334
335 opStoreLocalLong(code);
336 break;
337
338 default:
339
340 assert(0);
341 }
342 }
343
344 void negate(CodeContainer& code, char valueType)
345 {

Callers 1

parseKeywordMethod · 0.85

Calls 9

opPushIntFunction · 0.85
copyFunction · 0.85
opIntToFloatFunction · 0.85
opFloatToIntFunction · 0.85
opStoreLocalFloatFunction · 0.85
opStoreLocalShortFunction · 0.85
opStoreLocalLongFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected