acqn
761d00b7dc
Ignore running removed old optimization steps. Neither list them in help info.
2020-09-04 12:00:10 +02:00
acqn
ae340703f2
OptDupLoads shouldn't silently do optimizations.
2020-09-04 11:58:25 +02:00
acqn
f45d2515eb
Fixed OptPush1 in case later code would rely on that pushax zeroes register Y.
2020-09-04 11:58:25 +02:00
acqn
fb6bc275bc
Fixed evaluation flags propagation to subexpressions in assignments and function calls.
2020-09-02 21:36:59 +02:00
acqn
2379504449
Fixed AND/OR in certain cases where the 'E_NEED_TEST' flag set for usage only in subexpressions should be cleared.
2020-09-02 21:36:59 +02:00
acqn
28de3423eb
Merged some switch cases in code generation subroutines.
2020-08-31 09:12:03 +02:00
acqn
6b64b43395
Made local static data use a separated label pool from the code label pool.
2020-08-31 09:12:03 +02:00
acqn
9398e1cd33
Use a dedicated label pool for literals.
2020-08-31 09:12:03 +02:00
Oliver Schmidt
bee559d5f4
Merge pull request #1220 from acqn/StaticConst
...
[cc65] Fixed constant boolean expressions
2020-08-31 08:59:25 +02:00
acqn
74def4608a
The 'E_NEED_TEST' flag shouldn't be overwritten when loading the expression result.
2020-08-31 02:30:12 +08:00
acqn
c0a873e0c8
Reduced exess errors on wrong initializations with curly braces.
2020-08-30 17:35:48 +02:00
acqn
8b580e1191
Disabled struct/union fields of 'void' type.
2020-08-30 17:33:36 +02:00
acqn
f1161daee9
Recursively checking for incomplete/unknown-sized types.
2020-08-30 17:33:36 +02:00
acqn
8541f18340
Improved diagnostic info on assignment to void types.
2020-08-30 17:33:36 +02:00
acqn
abcc2a8f1a
Disallowed void arrays of elements of variant sizes.
2020-08-30 17:33:36 +02:00
acqn
d87846e1e1
Improved comments according to PR reviews.
2020-08-30 22:12:30 +08:00
acqn
60c59f59a3
Renamed StaticConstExpr() and StaticConstAbsIntExpr() with clearer comments.
2020-08-30 00:26:52 +08:00
acqn
df755df44d
Warning about ESU types declared inside parameter list as they are invisble outside.
2020-08-29 16:37:16 +02:00
acqn
33a75e0a73
Optimized parameter list checking.
...
Fixed function type comparison between ANSI and K&R styles.
2020-08-29 16:37:16 +02:00
acqn
0a96ffc878
Fixed function parameter checking.
...
Fixed function return type checking.
2020-08-29 16:37:16 +02:00
acqn
4e61ae5b36
Fixed function parameter type conversion.
2020-08-29 16:37:16 +02:00
acqn
632da3f4ee
Fixed tracking and checking flexible array members.
2020-08-29 16:35:42 +02:00
acqn
504aee3835
Merge branch 'master' into StaticConst
2020-08-27 06:27:23 +08:00
acqn
bb9c203222
Fixed integer promotion of unary operations.
2020-08-26 22:17:16 +02:00
acqn
8d225c32b1
Fixed checks on assignment to incomplete types.
2020-08-26 22:14:51 +02:00
acqn
43cb092a68
Fixed CHECK failures on certain usage of incomplete enums.
2020-08-26 22:14:51 +02:00
acqn
1957dc7a5c
Disallowed arrays of incomplete types.
...
Fixed diagnostics on incomplete local arrays.
2020-08-26 22:14:51 +02:00
acqn
f5b1b69376
Forbid struct/union fields of incomplete types.
2020-08-26 22:14:51 +02:00
Jesse Rosenstock
d38e5858f0
Add tests for #1211
...
CL_MoveRefs: Add CHECK (E->JumpTo != NULL) to make failure clearer.
2020-08-24 18:10:22 +02:00
acqn
c3a6b39945
Made struct assignment less hackish.
2020-08-24 18:02:29 +02:00
acqn
d1995fc81a
Fixed rvalue-ness of cast results.
2020-08-24 17:16:37 +02:00
acqn
911a79796d
Fixed checks and diagnostics on type-casting.
2020-08-24 17:16:37 +02:00
acqn
0486d28abc
Fixed Issue #327 .
2020-08-22 13:44:18 +02:00
acqn
f289ea6c14
Avoided generating unnecessary true-case labels in logic AND/OR.
2020-08-22 11:10:17 +08:00
acqn
0536f4f9bd
Minor fixes on constant expression checking and comments.
2020-08-21 23:27:41 +02:00
acqn
63256fd15d
Changed negation of signed long stored in unsigned long to unsigned subtraction.
2020-08-21 23:16:17 +02:00
acqn
f59c2a08d9
Added support for changing multiplications with certain negative multipliers into bit-shifts. Only enable certain kinds of signed mul replacements with shift according to the code size factor settings.
2020-08-21 23:16:17 +02:00
acqn
ea7336591c
Removed special-casing code for scaling up. Now it uses the normal multiplying code.
2020-08-21 23:16:17 +02:00
acqn
85ea06687b
Fixed logical AND and logical OR.
2020-08-20 07:52:15 +08:00
acqn
725511131a
Fixed constant expression checks with no-code requirement.
...
Used return-by-value initialization for ExprDesc.
2020-08-20 07:52:11 +08:00
acqn
3ea3887c77
Fixed warnings on const comparison.
...
Warnings on expressions with no effects.
Fixed const ternary.
Fixed ternary with struct/union types as the true/false-branch expressions.
2020-08-20 07:52:06 +08:00
acqn
17bbba7327
Added integer boolean type string.
...
No longer set the "expression tested" flag with constant results in comparison.
2020-08-20 07:52:03 +08:00
acqn
9fcde120aa
Made function signatures in asm output use the parameter lists from original definitions instead of the composites.
2020-08-19 08:40:19 +02:00
Greg King
36dd82f0e6
Added g_branch() to cc65's code generator.
...
It uses BRA if the platform's CPU has BRA. Else, it generates a JMP.
(Used it in the bitfield sign-extending code.)
2020-08-18 19:11:18 -04:00
Jesse Rosenstock
ff535b8e1a
Treat signed int bit-fields as signed
...
Prior to this PR, `int`, `signed int`, and `unsigned int`
bitfields are all treated as `unsigned int`.
With this PR, `signed int` will be treated as `signed int`,
and the others remain unsigned.
Since `Type` does not distinguish between `int` and `signed int`,
add an extra `int* SignenessSpecified` param to `ParseTypeSpec`
so we can tell these apart for bit-fields and treat plain `int : N`
as `unsigned int : N` since it is more efficient to zero-extend
than sign-extend.
Fixes #1095
2020-08-18 12:23:20 +02:00
Jesse Rosenstock
55cebc7b9e
Move bit-field adjustment to codegen.c
...
Extract functions g_testbitfield and g_extractbitfield from LoadExpr.
This helps prepare for #1192 , since g_extractbitfield will get much
longer and call AddCodeLine.
2020-08-18 10:55:31 +02:00
acqn
56b659c0be
Made char type a distinct type.
2020-08-18 10:48:38 +02:00
acqn
87889df9e9
Fixed type checking in relation operations.
2020-08-18 09:39:43 +02:00
acqn
f206833a20
Alternative fix for Issue #1167 .
2020-08-17 20:31:02 +02:00
acqn
0afa1a9a95
Fixed function signatures in asm output.
...
Improved full type name production.
2020-08-17 20:30:32 +02:00