Contents
So far, all analyses we learned are intraprocedural. So how to deal with method calls ?
Example. Const Propagation
void foo(){
int n = ten();
addOne(42);
}
int ten(){
return 10;
}
int addOne(int x){
int y = x + 1;
return y;
}
We assume that :
n = NAC, x = NAC, y = NAC ==> too conservative and may cause imprecision
So for better precision, we need interprocedural analysis: propagate data-flow information along interprocedural control-flow edges.
Thus, to preform interprocedural analysis, we need call graph.