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

Function adjust_result

v2/engine/function.c:2321–2343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2319}
2320
2321static void adjust_result( compiler * c, int actual_location,
2322 int desired_location )
2323{
2324 if ( actual_location == desired_location )
2325 ;
2326 else if ( actual_location == RESULT_STACK && desired_location == RESULT_RETURN )
2327 compile_emit( c, INSTR_SET_RESULT, 0 );
2328 else if ( actual_location == RESULT_STACK && desired_location == RESULT_NONE )
2329 compile_emit( c, INSTR_POP, 0 );
2330 else if ( actual_location == RESULT_RETURN && desired_location == RESULT_STACK )
2331 compile_emit( c, INSTR_PUSH_RESULT, 0 );
2332 else if ( actual_location == RESULT_RETURN && desired_location == RESULT_NONE )
2333 ;
2334 else if ( actual_location == RESULT_NONE && desired_location == RESULT_STACK )
2335 compile_emit( c, INSTR_PUSH_EMPTY, 0 );
2336 else if ( actual_location == RESULT_NONE && desired_location == RESULT_RETURN )
2337 {
2338 compile_emit( c, INSTR_PUSH_EMPTY, 0 );
2339 compile_emit( c, INSTR_SET_RESULT, 0 );
2340 }
2341 else
2342 assert( !"invalid result location" );
2343}
2344
2345static char const * parse_type( PARSE * parse )
2346{

Callers 1

compile_parseFunction · 0.85

Calls 1

compile_emitFunction · 0.85

Tested by

no test coverage detected