Ignore:
Timestamp:
Sep 9, 2024, 6:15:53 PM (36 hours ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
3d618a0
Parents:
478dade
Message:

Add separate compilation discussion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/jiada_liang_MMath/CFAenum.tex

    r478dade rd93b813  
    147147const T E_values [3] = { t1, t2, t3 };
    148148\end{cfa}
    149 The generated C enumeration will have enumerator values equals to their positions thanks to C's auto-initialization scheme. Notice that value and label arrays are dynamically allocated data structures that take up
     149The generated C enumeration will have enumerator values resemble \CFA enumerator positions thanks to C's auto-initialization scheme.
     150A \CFA enumeration variable definition is same in \CFA and C, before or after the transpilation.
     151For example:
     152\begin{cfa}
     153enum E e = E1;
     154e;
     155\end{cfa}
     156These two expressions will not change by \CFA-cc. A \CFA enumeration variable will always have the same underlying representation as its generated
     157C enumeration. This implies \CFA enumeration variable does not take up extra memory and \CFA enumeration use @posn@ as its underlying representation.
     158
     159Notice that value and label arrays are dynamically allocated data structures that take up
    150160memory. If an enumeration is globally defined, the arrays are allocated in the @.data@ section and will be initialized before the program execution.
    151161Otherwise, if an enumeration has its definition in a local scope, these arrays will be allocated on the stack and be initialized when the program counter
     
    212222
    213223
    214 \section{Auto Initialization}
     224\section{Initialization}
    215225\CFA extends C's auto-initialization scheme to \CFA enumeration. For an enumeration type with base type T, the initialization scheme is the following:
    216226\begin{enumerate}
Note: See TracChangeset for help on using the changeset viewer.