File Synthesis.html    Author McKeeman    Copyright © 2007    index

Synthesis of Executables

Overview

Synthesis is the process of using the information gathered during Analysis to extract the meaning (semantics) and construct an executable. In a typical compiler, an intermediate representation, or IR, holds the gathered information. In xcom the IR representing an X program consists of a syntax tree and associated symbol table. Since several X programs may cooperate (all but one defining subprograms), the synthesis algorithms need IR for all of the X programs before synthesizing the result.

The consequence is that the Analysis (often called the front-end) examines each input source program in order and constructs a sequence of IR representations, one for each program. This sequence is examined by the Synthesis (often called the back-end). At any moment the Synthesis is principally concerned with the IR for one subprogram, but may refer to other IRs for cross-program linking.

Back-end Components

  • Assembly. Formatting CPU instructions, putting them in memory, and executing them.
  • Instruction Selection. Transforming a sequence of semantic actions into a sequence of CPU actions.
  • The Execution Sequence. Transforming the IR into a sequence of semantic actions.