MCPcopy Create free account
hub / github.com/boostorg/build / adjust_result

Function adjust_result

src/engine/function.c:2372–2394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2370}
2371
2372static void adjust_result( compiler * c, int actual_location,
2373 int desired_location )
2374{
2375 if ( actual_location == desired_location )
2376 ;
2377 else if ( actual_location == RESULT_STACK && desired_location == RESULT_RETURN )
2378 compile_emit( c, INSTR_SET_RESULT, 0 );
2379 else if ( actual_location == RESULT_STACK && desired_location == RESULT_NONE )
2380 compile_emit( c, INSTR_POP, 0 );
2381 else if ( actual_location == RESULT_RETURN && desired_location == RESULT_STACK )
2382 compile_emit( c, INSTR_PUSH_RESULT, 0 );
2383 else if ( actual_location == RESULT_RETURN && desired_location == RESULT_NONE )
2384 ;
2385 else if ( actual_location == RESULT_NONE && desired_location == RESULT_STACK )
2386 compile_emit( c, INSTR_PUSH_EMPTY, 0 );
2387 else if ( actual_location == RESULT_NONE && desired_location == RESULT_RETURN )
2388 {
2389 compile_emit( c, INSTR_PUSH_EMPTY, 0 );
2390 compile_emit( c, INSTR_SET_RESULT, 0 );
2391 }
2392 else
2393 assert( !"invalid result location" );
2394}
2395
2396static char const * parse_type( PARSE * parse )
2397{

Callers 1

compile_parseFunction · 0.85

Calls 1

compile_emitFunction · 0.85

Tested by

no test coverage detected