Commit graph

686 commits

Author SHA1 Message Date
Dale Weiler
5d5b9a379a When storing to a vector member as part of an entity field we must use STOREP 2014-12-10 02:40:35 -05:00
Dale Weiler
b08195e2da Implemented length operator. This closes #130 2014-09-27 04:15:32 -04:00
Wolfgang Bumiller
3e576bd1f3 hopefully sanitize field creation logic a bit 2014-09-26 15:08:49 +02:00
Dale Weiler
25caf4b8e8 Fix 2014-08-11 20:59:34 -04:00
Dale Weiler
d5690074e1 Set name for is_varargs too. 2014-07-31 13:13:43 -04:00
Dale Weiler
823b053e60 Fix T...name 2014-07-31 12:37:26 -04:00
Dale Weiler
4c1c1bc051 Remove debug info from parse error. 2014-07-31 00:44:42 -04:00
Dale Weiler
161bbec262 Parameter omitting in fteqcc is disallowed. 2014-07-31 00:43:08 -04:00
Dale Weiler
53e9ed0d96 Merge branch 'arithmetic_exceptions' into cooking
Conflicts:
	doc/gmqcc.1
	gmqcc.ini.example
	opts.def
	parser.c
2014-05-25 03:01:47 -04:00
Wolfgang Bumiller
edb38ce70e local compile-time const values are now created as globals, thus they're now subject to constant-folding 2014-05-24 19:13:49 +02:00
Wolfgang Bumiller
536138273f propagate the 'inexact' flag on when initializing a constant 2014-05-24 17:53:29 +02:00
Dale Weiler
68c2baa7c1 Mage inexact travel across constants. 2014-05-24 11:50:16 -04: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
Wolfgang Bumiller
8dafdfc5e2 use INSTR_STATE by default, add -femulate-state to switch to emulation, and -state-fps=NUM to set its emulation FPS 2014-04-08 14:34:55 +02:00
Wolfgang Bumiller
0f506e768b sometimes I hate travis 2014-01-07 15:04:29 +01:00
Wolfgang Bumiller
792c1afd95 Do not create coverage calls on array accessors. 2014-01-07 15:01:52 +01:00
Wolfgang Bumiller
4ff68e07e8 Adding coverage support:
The -coverage option causes all values have AST_FLAG_BLOCK_COVERAGE
set by default.
The coverage attribute can be used to control coverage:
It takes an optional list of coverage types, currently only "block"
and "none" is recognized.
[[coverage]] defaults to [[coverage(block)]].
Use [[coverage(none)]] or [[coverage()]] to disable.
2014-01-07 14:36:00 +01:00
Dale Weiler
a934e0fe4b Happy new year! 2014-01-01 06:24:16 -05:00
Wolfgang Bumiller
5319caaaea definite -> last keyword; testcase updated too 2014-01-01 12:16:19 +01:00
Dale Weiler
0b6637cc67 Cleanup some code duplication. This whole parser ugh I just want to rm -rf all of it. Time for GMQCC2. 2014-01-01 05:32:24 -05:00
Dale Weiler
1e30c2b81d Remove final attribute and bareword. [[definite]] is now old [[final]]. There is no bareword definite either. 2014-01-01 05:12:21 -05:00
Wolfgang Bumiller
50f905b821 adding 'final' 2013-12-06 22:41:15 +01:00
Dale Weiler
072bff44e6 Bitshifting operators <<, >>, and compound assignment versions now work in non-constant expressions 2013-12-03 17:40:15 -05:00
Wolfgang Bumiller
c3cc6f184e static variables now don't get re-initialized in functions; cannot be initialized with non-constants anymore; and a counter has been added so you can use the same name in a different scope for another static variable again. 2013-11-28 12:04:01 +01:00
Dale Weiler
2d0f0a3607 Never mind 2013-11-25 13:32:02 -05:00
Dale Weiler
25e86c04eb Only g++ is this retarded 2013-11-25 13:30:45 -05:00
Dale Weiler
74b58c5bb8 Cleaner handling since intrin_func deals with alias 2013-11-23 07:02:45 -05:00
Dale Weiler
292c8150b4 Resolve undefined functions to compiler builtins if they exist. 2013-11-23 06:57:40 -05:00
Dale Weiler
1900262df4 Use a branch instead of math on enum types 2013-11-13 04:57:18 -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
Wolfgang Bumiller
3988aae73e type and argument parsing improved to handle the field/vararg ambiguity; tests added 2013-10-18 16:28:28 +02:00
Wolfgang Bumiller
8d5e719026 replacing the current [[accumulate]] implementation: shorter and simpler, and also supports non-void return types 2013-10-18 11:26:41 +02:00
Dale Weiler
02a1d9f4a1 Fix 'declaration does not declare anything' regression i.e this closes #132. 2013-10-17 05:06:09 -04:00
Dale Weiler
05ac126d6f Use "##" to ensure the names of the accumulated functions are striped by the IR. 2013-10-17 03:47:26 -04:00
Dale Weiler
4da820ef61 Enforce void type on accumulatable functions. 2013-10-17 03:39:14 -04:00
Dale Weiler
2c975bb344 Implemented [[accumulate]] attribute. This will hopefully be used by Xonotic to replace it's ACCUMULATE_FUNCTION stuff. 2013-10-17 03:21:30 -04:00
Dale Weiler
8699053887 Fix handling on intrinsic folding, this closes #118. 2013-10-17 00:14:42 -04:00
Dale Weiler
003bb9dfb4 Prevent aliasing functions through forward declared prototypes. This closes #125 2013-10-16 23:37:39 -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
Wolfgang Bumiller
82afdb1e2c Merge branch 'cooking' of git://github.com/graphitemaster/gmqcc into cooking 2013-10-11 14:10:57 +02:00
Wolfgang Bumiller
62ac7e9966 first part of parsing TOKEN_DOTS as part of a type when needed; allows declarations like: ...float x; 2013-10-11 14:10:47 +02:00
Dale Weiler
87d9371a5c Refactor some util/platform usage and extend file system file interface to accept its own flags and EOF 2013-10-11 06:12:56 -04:00
Dale Weiler
12a864abf5 Some more platform / compiler specific code refactoring. 2013-10-11 03:02:38 -04:00
Dale Weiler
151606e255 Initial platform / compiler specific code refactoring. 2013-10-11 02:39:30 -04:00
Dale Weiler
7249c2ec18 Simplify parse stage for unary - operator. 2013-09-29 22:08:09 -04:00
Dale Weiler
353455e1ad Remove pointless thinking comment, fix builds for clang. 2013-09-29 22:06:26 -04:00
Dale Weiler
b10de1b240 Make unary - operator act as an ast_unary node. This allows for consistency (no sense in making unary use binstore nodes, it doesn't make much sense). It also allows for the peephole optimization on unary chains that cancel each other to take place; i.e code like "-(-a)" simplifies to "a", thus eliminating instructions. 2013-09-29 22:01:46 -04:00
Dale Weiler
d61c5d3b16 Fix alias type check 2013-09-26 08:09:55 -04:00
Dale Weiler
894e1976e3 Cheap quick hack for ignoring #pragma to EOL 2013-09-25 15:35:18 -04:00
Dale Weiler
73eca0848c Fix QuakeWorld compilation by treating assignment to constants as a warning when -std=qcc. 2013-09-24 07:31:53 -04:00