Machine-translated by Google. Questions are authored in English.
Top

Discussion

Storage allocation decisions such as the offset of a local variable in an activation record are made

  • A.by the linker while resolving the external references
  • B.in the back end, once the target machine layout is known
  • C.by the lexical analyser as the declaration is first scanned
  • D.by the preprocessor before the compiler ever sees the file

Answer: B

Correct answer: in the back end, once the target machine layout is known

An offset within an activation record depends on the sizes and alignments of the target's data types and on its calling convention - none of which the front end knows.

The decision therefore belongs to the back end, along with register allocation and instruction selection. The linker resolves addresses between modules rather than within a frame, the scanner has no notion of layout, and the preprocessor works on text before any of this arises.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.