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

Function evaluate_rule

src/engine/compile.cpp:58–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56 */
57
58LIST * evaluate_rule( RULE * rule, OBJECT * rulename, FRAME * frame )
59{
60 LIST * result = L0;
61 profile_frame prof[ 1 ];
62 module_t * prev_module = frame->module;
63
64 if ( DEBUG_COMPILE )
65 {
66 /* Try hard to indicate in which module the rule is going to execute. */
67 char buf[ 256 ] = "";
68 if ( rule->module->name )
69 {
70 strncat( buf, object_str( rule->module->name ), sizeof( buf ) -
71 1 );
72 strncat( buf, ".", sizeof( buf ) - 1 );
73 if ( strncmp( buf, object_str( rule->name ), strlen( buf ) ) == 0 )
74 {
75 buf[ 0 ] = 0;
76 }
77 }
78 strncat( buf, object_str( rule->name ), sizeof( buf ) - 1 );
79 debug_compile( 1, buf, frame );
80
81 lol_print( frame->args );
82 out_printf( "\n" );
83 }
84
85 if ( rule->procedure && rule->module != prev_module )
86 {
87 /* Propagate current module to nested rule invocations. */
88 frame->module = rule->module;
89 }
90
91 /* Record current rule name in frame. */
92 if ( rule->procedure )
93 {
94 frame->rulename = object_str( rulename );
95 /* And enter record profile info. */
96 if ( DEBUG_PROFILE )
97 profile_enter( function_rulename( rule->procedure ), prof );
98 }
99
100 /* Check traditional targets $(<) and sources $(>). */
101 if ( !rule->actions && !rule->procedure )
102 unknown_rule( frame, NULL, frame->module, rulename );
103
104 /* If this rule will be executed for updating the targets then construct the
105 * action for make().
106 */
107 if ( rule->actions )
108 {
109 TARGETS * t;
110
111 /* The action is associated with this instance of this rule. */
112 ACTION * const action = (ACTION *)BJAM_MALLOC( sizeof( ACTION ) );
113 memset( (char *)action, '\0', sizeof( *action ) );
114
115 action->rule = rule;

Callers 10

headersFunction · 0.85
call_timing_ruleFunction · 0.85
call_action_ruleFunction · 0.85
bjam_callFunction · 0.85
function_call_ruleFunction · 0.85
type_check_rangeFunction · 0.85
call_bind_ruleFunction · 0.85
call_ruleFunction · 0.85
sequence_transformFunction · 0.85

Calls 15

object_strFunction · 0.85
debug_compileFunction · 0.85
lol_printFunction · 0.85
out_printfFunction · 0.85
profile_enterFunction · 0.85
function_rulenameFunction · 0.85
unknown_ruleFunction · 0.85
targetlistFunction · 0.85
lol_getFunction · 0.85
targetentryFunction · 0.85
actionlistFunction · 0.85
action_freeFunction · 0.85

Tested by

no test coverage detected