ABSTRACT

This chapter details the intermediate representation (IR) and related concepts. The IR encapsulates both the statements and the control-flow contained by a program. The chapter provides an overview of the reference-counting mechanism used by Sh and explains the way basic blocks are stored. Basic blocks are represented in Sh by the ShBasicBlock class. Most Sh operations are arithmetic or logic in nature. Sh programs can include more than just basic blocks: they can contain arbitrary data-dependent control flow. Many types in Sh are actually reference-counted. This means that for each object declared of such a type, a count is kept of how many pointer variables refer to it.