Wolfgang Bumiller
047ecd426f
move more parser code to c++, fix crashes with gcc
...
we initialized the parser with malloc -> memset to zero ->
placement new. With gcc the latter caused the memset to be
optimized out, causing uninitialized value accesses.
2017-07-23 10:11:31 +02:00
Dale Weiler
db9c37d18b
Rewrite constant folder in C++
2015-01-15 20:27:17 -05:00
Dale Weiler
e2ba77a546
Rewrite intrinsic system in C++
2015-01-15 18:11:41 -05:00
Dale Weiler
b345b4e21b
Eliminate use of vec_ in intrin.cpp
2015-01-15 03:01:26 -05:00
Dale Weiler
9c31c53cc5
Eliminate use of vec_ in fold.c
2015-01-15 02:47:42 -05:00
Dale Weiler
b5d8b44503
More std::vector
2015-01-15 01:35:56 -05:00
Dale Weiler
aabefd1bfe
Use C++ naming for structures
2015-01-14 23:56:52 -05:00
Dale Weiler
67a3c9b031
Initial movement to std::vector
2015-01-14 23:34:43 -05:00
Dale Weiler
b5ac2745d6
Remove license headers. The LICENSE file is sufficent
2015-01-13 21:38:40 -05:00
Dale Weiler
a77797d6a6
Remove spelling corrector
2015-01-13 19:48:57 -05:00
Dale Weiler
783b7b6594
Update license headers
2015-01-09 14:53:35 -05:00
Dale Weiler
6424ebaf98
Perliminary work on arithmetic exception handling in the constant evaluator. We can safely check for arithmetic underflow, overflow, divison by zero and inexactness now. Inexactness of expressions are propagated through the AST such that using an inexact value in a comparison will trigger a warning with -Winexact-compares.
2014-05-24 09:53:38 -04:00
Dale Weiler
a934e0fe4b
Happy new year!
2014-01-01 06:24:16 -05:00
Wolfgang Bumiller
b1016c7f48
fold_binary now used instead of ast_binary_new, which calls fold_superfluous
2013-10-25 13:40:31 +02:00
Dale Weiler
8699053887
Fix handling on intrinsic folding, this closes #118 .
2013-10-17 00:14:42 -04:00
Dale Weiler
50d165e173
Some intrinsic code cleanup. The args check is handled anyways in the parser. We use a generated array alongside to prevent generating the intrinsic multiple times instead of using static storage. Other various cleanups as well.
2013-10-16 00:04:39 -04:00
Dale Weiler
cc69370575
Another peephole optimization which removes superfluous expressions such as (A + 0), (A - 0), (A * 1) and (A / 1).
2013-10-04 06:46:54 -04:00
Dale Weiler
15b0555546
Implement constant folding on ternary operations via fold_cond.
2013-09-26 06:51:49 -04:00
Dale Weiler
a50635bcd7
intrinsic folding cleanups (and improvements.)
2013-08-30 07:12:16 -04:00
Dale Weiler
3b4a5667ea
Constant fold intrinsics if their arguments are constant. TODO: reference count intrinsics such that they're not generated unless they're used, currently when an intrinsic can be folded-away it's marked for generation and makes it to the final output binary even though it isn't used.
2013-08-28 12:46:22 -04:00
Dale Weiler
73d9aa29c4
Made intrinsics seperate from the parser.
2013-08-14 06:02:15 +00:00
Dale Weiler
10b75fd8b9
Move const-branch-elision into fold.c
2013-07-31 19:34:38 +00:00
Dale Weiler
d0ee56f25f
more fixes
2013-07-31 16:31:45 +00:00
Dale Weiler
920dbaf1e0
Work in progress constant-folding rewrite.
2013-07-31 09:04:19 +00:00