A Simple CPS Transformation of Control-Flow Information

  • Daniel Damian
  • Olivier Danvy

Abstract

We build on Danvy and Nielsen's first-order program transformation into continuation-passing style (CPS) to design a new CPS transformation of flow information that is simpler and more efficient than what has been presented in previous work. The key to simplicity and efficiency is that our CPS transformation constructs the flow information in one go, instead of first computing an intermediate result and then exploiting it to construct the flow information.

More precisely, we show how to compute control-flow information for CPS-transformed programs from control-flow information for direct-style programs and vice-versa. As a corollary, we confirm that CPS transformation has no effect on the control-flow information obtained by constraint-based control-flow analysis. The transformation has immediate applications in assessing the effect of the CPS transformation over other analyses such as, for instance, binding-time analysis.
Published
2001-12-04
How to Cite
Damian, D., & Danvy, O. (2001). A Simple CPS Transformation of Control-Flow Information. BRICS Report Series, 8(55). https://doi.org/10.7146/brics.v8i55.21716