Ignore:
Timestamp:
Sep 7, 2021, 12:26:06 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
031453c
Parents:
1341ce1 (diff), 812ba3d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/andrew_beach_MMath/code/fixup-other-f.cfa

    r1341ce1 r2bfee8e  
    22#include <clock.hfa>
    33#include <fstream.hfa>
    4 #include <stdlib.hfa>                                                                   // strto
     4#include <stdlib.hfa>
    55
    6 unsigned int frames;                                                                    // use global because of gcc thunk problem
     6// Using a global value to allow hoisting (and avoid thunks).
     7unsigned int frames;
    78
    89void nounwind_fixup(unsigned int dummy, void (*raised_rtn)(int &), void (*not_raised_rtn)(int &)) {
    910        void not_raised(int & fixup) {
    10                 fixup = frames + 42;                                                    // use local scope => lexical link
     11                fixup = frames + 42;
    1112        }
    1213
     
    1415                frames -= 1;
    1516                nounwind_fixup(42, raised_rtn, not_raised);
     17                // Always false, but prevents recursion elimination.
     18                if (-1 == frames) printf("~");
    1619        } else {
    1720                int fixup = dummy;
     
    3134        frames = total_frames;
    3235
     36        // Closures at the top level are allowed to be true closures.
    3337        void raised(int & fixup) {
    34                 fixup = total_frames + 42;                                              // use local scope => lexical link
     38                fixup = total_frames + 42;
    3539        }
    3640        void not_raised(int & fixup) {
    37                 fixup = total_frames + 42;                                              // use local scope => lexical link
     41                fixup = total_frames + 42;
    3842        }
    3943
Note: See TracChangeset for help on using the changeset viewer.