Ignore:
Timestamp:
Sep 15, 2024, 12:25:59 PM (5 weeks ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
68a7028
Parents:
17fdf6f
Message:

Update on thesis

File:
1 edited

Legend:

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

    r17fdf6f r0c88135  
    145145\begin{cfa}
    146146enum E { E1, E2, E3 };
    147 static const char * E_labels[3] = { "E1", "E2", "E3" };
    148 static const T E_values[3] = { t1, t2, t3 };
     147const char * E_labels[3] = { "E1", "E2", "E3" };
     148const T E_values[3] = { t1, t2, t3 };
    149149\end{cfa}
    150150The generated C enumeration has enumerator values that match \CFA enumerator positions because of C's auto-initialization.
     
    156156so these expressions remain unchanged by \CFA-cc.
    157157Therefore, a \CFA enumeration variable has the same underlying representation as its generated C enumeration.
    158 This semantics implies a \CFA enumeration variable does not use memory, that @posn@ can use its underlying representation, and the label and value arrays take little storage.
     158This semantics implies a \CFA enumeration variable uses the same storages as a C enumeration variable that @posn@ can use as its underlying representation, and the label and value arrays take little storage.
    159159It should be possible to eliminated the two arrays if unused, either by \CFA if local to a translation unit and unused, or by the linker if global but unreferenced.
    160160Also, the label and value arrays are declared @static@ and initialized with constants, so the arrays are allocated in the @.data@ section and initialized before program execution.
Note: See TracChangeset for help on using the changeset viewer.