CFG: Function Call with Parameters and Return Value

The CFG for a function call with parameters and a return value is shown in the example below. The dashed horizontal lines show the inter-procedural CFG edges; the vertical dotted line shows an intra-procedural edge that is omitted from the inter-procedural CFG.

For the example CFG shown, the parameter evaluation order is right-to-left: this is the order used by all supported platforms.

Note that although actual parameters are in the CFG, formal parameters are not.

The function assigns the return value to a generated local variable (f$return); the actual-out vertex represents the assignment of the return value (f$return) to a generated local variable of the caller (f$result0); the subsequent expression vertex uses the result (f$result0) as the value of the function call.

Example

... 
x = f(1, 2);
...
diagram: CFG for example code
int f(int a, int b){
    return 0; 
}

Browse