Commit Graph

35 Commits

Author SHA1 Message Date
acqn e9545d68ee Minor clean-ups and typo fixes. 2021-04-17 11:43:03 +08:00
acqn 5adb29ce31 Made "bit-field-ness" a type property instead of a SymbolEntry or ExprDesc property.
Fixed integer promotion and result type in certain operations.
Fixed bit-fields 'op=' and postfix inc/dec operators.
2021-06-09 08:03:12 +02:00
acqn dcacba472a Moved ArithmeticConvert() from cc65/expr.c to cc65/datatype.c.
Reorganized a few functions in cc65/datatype.c.
Added SignedType() and UnsignedType() for future usage.
Made LimitExprValue() external so that it can be used more often.
2021-06-09 08:03:12 +02:00
acqn bd5d5b7385 Removed the prototype of evalexpr() that no longer exists. 2021-03-16 22:24:19 +01:00
Christian Groessler ef258bdc19 remove TABs which again slipped in.... 2020-12-25 07:16:26 +01:00
acqn 5c43d1e04f Changed codegen for postfix inc/dec operations by deferring them till sequence points.
This usually allows faster & smaller code.
Note that deferred operations must still be called at sequence points even if the whole expressions containing them had constant values.
2020-10-20 22:01:55 +02:00
acqn 60c59f59a3 Renamed StaticConstExpr() and StaticConstAbsIntExpr() with clearer comments. 2020-08-30 00:26:52 +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
Greg King 0390c34e88 Changed multi-line C comments into another style.
The left side doesn't look unbalanced.
2014-06-30 16:51:07 -04:00
Oliver Schmidt 4185caf855 Normalized code. 2014-03-04 01:11:19 +01:00
Oliver Schmidt 85885001b1 Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
uz 0c20177fce Allow to store start and end of generated code in the ExprDesc structure. New
function MarkedExprWithCheck.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4135 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-08 19:48:22 +00:00
cuz de3a20a898 Changed the low level type representation from a strung of unsigned short
elements to a string of structs, each representing one type element. This
should fix problems on unusual architectures, since it is no longer necessary
to embedd pointers and other data converted to numbers in the string of
unsigned shorts.
Increased the TypeCode length to unsigned long to make room for more type
bits.
Inline more functions in datatype.h.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3709 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-02-19 12:29:37 +00:00
cuz 40d01eb4ce Fixed bug with braces in initializer lists
git-svn-id: svn://svn.cc65.org/cc65/trunk@3193 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-09-23 17:34:03 +00:00
cuz daf8e0d1e6 Added license information preproc.h
git-svn-id: svn://svn.cc65.org/cc65/trunk@3135 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-06-29 20:26:27 +00:00
cuz 8752f0b2c1 Removed ExprLoad to LoadExpr.
Moved LoadExpr + support functions into a separate module.
Removed obsolete files.
Some cleanup and makefile adjustments.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3113 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-06-09 14:12:57 +00:00
cuz 104ae3a54f Move the compiler stack pointer into its own module.
Improved the inlining of standard C functions. Added more standard functions
to inline.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3095 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-06-05 11:35:53 +00:00
cuz 8d8162eb23 Rewrite/cleanup of the complete expression flags handling.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3056 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-05-31 15:27:33 +00:00
cuz 878e4f1352 Changed the expression parser to return the lvalue flag as part of the
ExprDesc structure, not as separate value.
WARNING: The current code does compile but does not work correctly, because
the lvalue flag is part of ExprDesc.Flags and not masked out in several tests
throughout the code.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3046 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-05-25 20:59:38 +00:00
cuz e47ed98aa7 Move the expression test code into separate modules.
The Test() and TestInParens() functions do now return information about the
expression that was tested.
An if... statement where the expression is always true will now print a
warning "Unreachable code" if it has an else clause.


git-svn-id: svn://svn.cc65.org/cc65/trunk@2889 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-03-02 18:00:08 +00:00
cuz 14fc5c1073 Renamed exprhs to ExprLoad
git-svn-id: svn://svn.cc65.org/cc65/trunk@2426 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-08-29 09:16:28 +00:00
cuz 81f94afd5c Rewrote type conversions
git-svn-id: svn://svn.cc65.org/cc65/trunk@2262 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-08-11 20:18:30 +00:00
cuz 4e2110a7a9 Fixed the inlined strlen function
git-svn-id: svn://svn.cc65.org/cc65/trunk@1738 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-12-12 17:40:58 +00:00
cuz 89f00263af Fixed a problem with the test expression in a for loop: It was not evaluated
correctly if it did not contain an explicit comparison operator.
Removed an old hack from the test subroutine that did no longer work.


git-svn-id: svn://svn.cc65.org/cc65/trunk@1619 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-11-24 18:18:16 +00:00
cuz 8810e38bb7 Move the assignment parser into a separate module.
When assigning structures, copy them using the primary register when the
size is 1, 2, or 4.
When assigning structures, allow structures by value when the size is 1,
2, or 4. These structures are expected to be in the primary register. The
only case when this can happen is by return from function, so this change
makes div() work.


git-svn-id: svn://svn.cc65.org/cc65/trunk@1477 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-11-01 21:27:31 +00:00
cuz 5548b6fd56 Work on better type casts - not yet finished
git-svn-id: svn://svn.cc65.org/cc65/trunk@1476 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-11-01 15:16:16 +00:00
cuz 3b5808788b Add #pragma charmap()
Cosmetical changes.


git-svn-id: svn://svn.cc65.org/cc65/trunk@1162 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-02-18 08:40:11 +00:00
cuz 23fbf3ff2a Adding functionality to StrBuf
git-svn-id: svn://svn.cc65.org/cc65/trunk@885 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-09-09 20:49:20 +00:00
cuz eaf1304b71 Make flag constants unsigned
git-svn-id: svn://svn.cc65.org/cc65/trunk@834 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-08-03 06:45:22 +00:00
cuz f249ae345e More renaming. Remove the case label limit by using a collection to store
the switch entries.


git-svn-id: svn://svn.cc65.org/cc65/trunk@807 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-07-17 21:53:17 +00:00
cuz c571214513 More renaming
git-svn-id: svn://svn.cc65.org/cc65/trunk@806 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-07-17 21:29:21 +00:00
cuz cc83744882 Renamed struct expent
git-svn-id: svn://svn.cc65.org/cc65/trunk@805 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-07-17 21:24:19 +00:00
cuz 4d34ce83d7 Remove unused flags
git-svn-id: svn://svn.cc65.org/cc65/trunk@577 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-12-09 21:09:52 +00:00
cuz 0ab45f63f0 Fixed a bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@550 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-12-04 21:01:50 +00:00
uz 53dd513176 This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-05-28 13:40:48 +00:00