code generation final phase