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

Function adjust_result

src/engine/function.cpp:2542–2564  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2540}
2541
2542static void adjust_result( compiler * c, int32_t actual_location,
2543 int32_t desired_location )
2544{
2545 if ( actual_location == desired_location )
2546 ;
2547 else if ( actual_location == RESULT_STACK && desired_location == RESULT_RETURN )
2548 compile_emit( c, INSTR_SET_RESULT, 0 );
2549 else if ( actual_location == RESULT_STACK && desired_location == RESULT_NONE )
2550 compile_emit( c, INSTR_POP, 0 );
2551 else if ( actual_location == RESULT_RETURN && desired_location == RESULT_STACK )
2552 compile_emit( c, INSTR_PUSH_RESULT, 0 );
2553 else if ( actual_location == RESULT_RETURN && desired_location == RESULT_NONE )
2554 ;
2555 else if ( actual_location == RESULT_NONE && desired_location == RESULT_STACK )
2556 compile_emit( c, INSTR_PUSH_EMPTY, 0 );
2557 else if ( actual_location == RESULT_NONE && desired_location == RESULT_RETURN )
2558 {
2559 compile_emit( c, INSTR_PUSH_EMPTY, 0 );
2560 compile_emit( c, INSTR_SET_RESULT, 0 );
2561 }
2562 else
2563 assert( !"invalid result location" );
2564}
2565
2566static void compile_append_chain( PARSE * parse, compiler * c )
2567{

Callers 1

compile_parseFunction · 0.85

Calls 1

compile_emitFunction · 0.85

Tested by

no test coverage detected