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

Function evaluate_rule

v2/engine/compile.c:57–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 10

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

Calls 15

object_strFunction · 0.85
debug_compileFunction · 0.85
lol_printFunction · 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
function_referFunction · 0.85

Tested by

no test coverage detected