Generate APF program during size estimation

This commit modifies the code to generate the APF program simultaneously
with the size estimation.

Test: TH
Change-Id: Ia04258b053b498216725daf468f98656493dedc8
1 file changed