Changes in / [2bfee8e:1341ce1]
- Files:
-
- 6 deleted
- 8 edited
-
doc/theses/andrew_beach_MMath/code/fixup-empty-f.cfa (modified) (2 diffs)
-
doc/theses/andrew_beach_MMath/code/fixup-empty-r.cfa (modified) (2 diffs)
-
doc/theses/andrew_beach_MMath/code/fixup-other-f.cfa (modified) (3 diffs)
-
doc/theses/andrew_beach_MMath/code/fixup-other-r.cfa (modified) (3 diffs)
-
doc/theses/andrew_beach_MMath/code/resume-empty.cfa (modified) (1 diff)
-
doc/theses/andrew_beach_MMath/code/test.sh (modified) (1 diff)
-
doc/theses/andrew_beach_MMath/code/throw-empty.cpp (modified) (2 diffs)
-
libcfa/src/Makefile.am (modified) (1 diff)
-
libcfa/src/containers/string.cfa (deleted)
-
libcfa/src/containers/string.hfa (deleted)
-
libcfa/src/containers/string_res.cfa (deleted)
-
libcfa/src/containers/string_res.hfa (deleted)
-
tests/collections/.expect/string-api-coverage.txt (deleted)
-
tests/collections/string-api-coverage.cfa (deleted)
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/code/fixup-empty-f.cfa
r2bfee8e r1341ce1 2 2 #include <clock.hfa> 3 3 #include <fstream.hfa> 4 #include <stdlib.hfa> 4 #include <stdlib.hfa> // strto 5 5 6 voidnounwind_fixup(unsigned int frames, void (*raised_rtn)(int &)) {6 int nounwind_fixup(unsigned int frames, void (*raised_rtn)(int &)) { 7 7 if (frames) { 8 nounwind_fixup(frames - 1, raised_rtn); 9 // "Always" false, but prevents recursion elimination. 10 if (-1 == frames) printf("~"); 8 int rtn = nounwind_fixup(frames - 1, raised_rtn); 9 if ( rtn == 42 ) printf( "42" ); // make non-tail recursive 10 return rtn; 11 11 12 } else { 12 13 int fixup = 17; 13 14 raised_rtn(fixup); 15 return fixup; 14 16 } 15 17 } … … 25 27 } 26 28 27 // Closures at the top level are allowed to be true closures.28 29 void raised(int & fixup) { 29 fixup = total_frames + 42; 30 if ( total_frames == 42) printf("42");30 fixup = total_frames + 42; // use local scope => lexical link 31 if ( total_frames == 42 ) printf( "42" ); 31 32 } 32 33 -
doc/theses/andrew_beach_MMath/code/fixup-empty-r.cfa
r2bfee8e r1341ce1 3 3 #include <exception.hfa> 4 4 #include <fstream.hfa> 5 #include <stdlib.hfa> 5 #include <stdlib.hfa> // strto 6 6 7 7 exception fixup_exception { … … 10 10 vtable(fixup_exception) fixup_vt; 11 11 12 voidnounwind_empty(unsigned int frames) {12 int nounwind_empty(unsigned int frames) { 13 13 if (frames) { 14 nounwind_empty(frames - 1);15 // "Always" false, but prevents recursion elimination.16 if (-1 == frames) printf("~");14 int rtn = nounwind_empty(frames - 1); 15 if ( rtn == 42 ) printf( "42" ); // make non-tail recursive 16 return rtn; 17 17 } else { 18 18 int fixup = 17; 19 throwResume (fixup_exception){&fixup_vt, fixup}; 19 throwResume (fixup_exception){&fixup_vt, fixup}; // change bad fixup 20 return fixup; 20 21 } 21 22 } -
doc/theses/andrew_beach_MMath/code/fixup-other-f.cfa
r2bfee8e r1341ce1 2 2 #include <clock.hfa> 3 3 #include <fstream.hfa> 4 #include <stdlib.hfa> 4 #include <stdlib.hfa> // strto 5 5 6 // Using a global value to allow hoisting (and avoid thunks). 7 unsigned int frames; 6 unsigned int frames; // use global because of gcc thunk problem 8 7 9 8 void nounwind_fixup(unsigned int dummy, void (*raised_rtn)(int &), void (*not_raised_rtn)(int &)) { 10 9 void not_raised(int & fixup) { 11 fixup = frames + 42; 10 fixup = frames + 42; // use local scope => lexical link 12 11 } 13 12 … … 15 14 frames -= 1; 16 15 nounwind_fixup(42, raised_rtn, not_raised); 17 // Always false, but prevents recursion elimination.18 if (-1 == frames) printf("~");19 16 } else { 20 17 int fixup = dummy; … … 34 31 frames = total_frames; 35 32 36 // Closures at the top level are allowed to be true closures.37 33 void raised(int & fixup) { 38 fixup = total_frames + 42; 34 fixup = total_frames + 42; // use local scope => lexical link 39 35 } 40 36 void not_raised(int & fixup) { 41 fixup = total_frames + 42; 37 fixup = total_frames + 42; // use local scope => lexical link 42 38 } 43 39 -
doc/theses/andrew_beach_MMath/code/fixup-other-r.cfa
r2bfee8e r1341ce1 3 3 #include <exception.hfa> 4 4 #include <fstream.hfa> 5 #include <stdlib.hfa> 5 #include <stdlib.hfa> // strto 6 6 7 7 exception fixup_exception { … … 13 13 }; 14 14 15 // Using a global value to allow hoisting (and avoid thunks). 16 unsigned int frames; 15 unsigned int frames; // use global because of gcc thunk problem 17 16 18 17 void nounwind_other(unsigned int dummy) { … … 21 20 try { 22 21 nounwind_other(42); 23 // Always false, but prevents recursion elimination.24 if (-1 == frames) printf("~");25 22 } catchResume (not_raised_exception * ex) { 26 ex->fixup = frames + 42; 23 ex->fixup = frames + 42; // use local scope => lexical link 27 24 } 28 25 } else { 29 26 int fixup = dummy; 30 throwResume (fixup_exception){&fixup_vt, fixup}; 27 throwResume (fixup_exception){&fixup_vt, fixup}; // change bad fixup 31 28 } 32 29 } -
doc/theses/andrew_beach_MMath/code/resume-empty.cfa
r2bfee8e r1341ce1 11 11 if (frames) { 12 12 nounwind_empty(frames - 1); 13 if ( frames == -1 ) printf( "42" ); // prevent recursion optimizations14 13 } else { 15 14 throwResume (empty_exception){&empty_vt}; -
doc/theses/andrew_beach_MMath/code/test.sh
r2bfee8e r1341ce1 12 12 # test.sh -v LANGUAGE TEST FILE 13 13 # View the result from TEST in LANGUAGE stored in FILE. 14 15 readonly DIR=$(dirname "$(readlink -f "$0")")16 cd $DIR17 14 18 15 readonly MIL=000000 -
doc/theses/andrew_beach_MMath/code/throw-empty.cpp
r2bfee8e r1341ce1 1 1 // Throw Across Empty Function 2 2 #include <chrono> 3 #include <cstdio>4 3 #include <cstdlib> 5 4 #include <exception> … … 15 14 if (frames) { 16 15 unwind_empty(frames - 1); 17 if (-1 == frames) printf("~");18 16 } else { 19 17 throw (EmptyException){}; -
libcfa/src/Makefile.am
r2bfee8e r1341ce1 87 87 containers/pair.hfa \ 88 88 containers/result.hfa \ 89 containers/string.hfa \90 containers/string_res.hfa \91 89 containers/vector.hfa \ 92 90 device/cpu.hfa
Note:
See TracChangeset
for help on using the changeset viewer.