1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-26 05:29:30 +00:00
Commit Graph

109 Commits

Author SHA1 Message Date
cuz
9df7321d90 Cleanup in ShiftExpr.
Changed GetCodePos to also remember the stack pointer at the given location,
this removes the necessity to manipulate the stack when removing code. Since
CodeMark is now a struct, the API for most asmcode functions has changed.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3145 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-07-06 11:30:08 +00:00
cuz
e354d269f6 Remove shifts from kcalc
git-svn-id: svn://svn.cc65.org/cc65/trunk@3139 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-06-29 20:44:50 +00:00
cuz
809d1408ce Move shift expression evaluation into a separate module. More checks and
improvements for shift expressions.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3138 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-06-29 20:44:01 +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
d8279302a9 Make the -O and --codesize options stackable.
Copy the current optimization settings into a code segment on creation.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3129 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-06-15 20:29:49 +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
8425d988fe Removed debug code
git-svn-id: svn://svn.cc65.org/cc65/trunk@3110 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-06-06 18:36:15 +00:00
cuz
f500a641c5 Added support for floating point constants in the scanner and Primary()
git-svn-id: svn://svn.cc65.org/cc65/trunk@3108 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-06-06 15:59:44 +00:00
cuz
9fc71c5e93 Renamed ExprDesc.Val to ExprDesc.IVal. Added an FVal field for a floating
point constant.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3107 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-06-06 14:48:59 +00:00
cuz
5586527fcc Move the test flags into the Flags bitset of struct ExprDesc
git-svn-id: svn://svn.cc65.org/cc65/trunk@3101 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-06-05 20:29:47 +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
87d0d88986 Check the InlineStdFuncs flag later
git-svn-id: svn://svn.cc65.org/cc65/trunk@3086 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-06-04 14:37:50 +00:00
cuz
8c4b3599a2 Fixed a typo
git-svn-id: svn://svn.cc65.org/cc65/trunk@3073 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-06-03 12:09:24 +00:00
cuz
2fa9b6e5ac Improved code generation
git-svn-id: svn://svn.cc65.org/cc65/trunk@3072 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-06-03 12:08:49 +00:00
cuz
01104d26ea Fixed generation of non optimal code in StructRef()
git-svn-id: svn://svn.cc65.org/cc65/trunk@3071 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-06-03 11:10:30 +00:00
cuz
6e34e386cb Rewrote code generation for the strlen standard function. Added code for
other standard functions in several places.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3069 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-06-02 21:33:35 +00:00
cuz
111c69a826 String literals can be handled as static data in most cases
git-svn-id: svn://svn.cc65.org/cc65/trunk@3062 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-05-31 19:51:13 +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
fedb566ff1 Some renaming and restructuring
git-svn-id: svn://svn.cc65.org/cc65/trunk@3050 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-05-26 16:15:28 +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
89fc8f3df7 Fixed a bug: The volatile keyword was not accepted in type casts or as
argument to the sizeof operator, if the type spec is starting with this
keyword.


git-svn-id: svn://svn.cc65.org/cc65/trunk@2921 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-03-13 22:37:13 +00:00
cuz
d0ea9f34b6 Made several options that can be changed by #pragmas stackable.
Added new #pragma regvars.


git-svn-id: svn://svn.cc65.org/cc65/trunk@2902 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-03-07 21:53:35 +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
f4e5baa444 Fixed a bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@2437 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-09-14 11:12:27 +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
7989e202a6 Fixed a type conversion bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@2419 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-08-27 19:40:40 +00:00
cuz
aef8789873 Fixed several type conversion issues
git-svn-id: svn://svn.cc65.org/cc65/trunk@2380 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-08-20 08:32:07 +00:00
cuz
e20bda21b3 Fixed type conversion problems
git-svn-id: svn://svn.cc65.org/cc65/trunk@2371 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-08-19 20:31:10 +00:00
cuz
a70d466e3e Fixed a bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@2351 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-08-17 15:20:18 +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
73dfa23c98 Fixed a bug that caused problems locating the last parameter of a function
git-svn-id: svn://svn.cc65.org/cc65/trunk@2259 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-08-10 17:05:18 +00:00
cuz
d5b3ff4bca Fixed a bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@2234 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-07-26 07:31:15 +00:00
cuz
8b3ab210be Fixed a bug in character literal handling
git-svn-id: svn://svn.cc65.org/cc65/trunk@2029 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-03-17 20:18:58 +00:00
cuz
c008e555b2 Fixed a bug in sign extension of constant values
git-svn-id: svn://svn.cc65.org/cc65/trunk@1998 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-03-04 10:46:27 +00:00
cuz
c5868d30c0 Fixed a bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@1922 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-02-02 21:05:39 +00:00
cuz
abcc981253 Move the Debug flag into a new module "debugflag" in the common directory.
Remove the const qualifier from the argument of xfree().


git-svn-id: svn://svn.cc65.org/cc65/trunk@1877 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-01-04 16:59:51 +00:00
cuz
ed2bb59bcb Fixed a bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@1862 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-12-29 21:23:28 +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
ede471904c Reenable register variables
git-svn-id: svn://svn.cc65.org/cc65/trunk@1625 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-11-24 23:31:54 +00:00
cuz
b6898c3f1e Check register before static
git-svn-id: svn://svn.cc65.org/cc65/trunk@1624 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-11-24 21:07:39 +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
ca1386e9d4 Removed unused code
git-svn-id: svn://svn.cc65.org/cc65/trunk@1522 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-11-14 22:52:29 +00:00
cuz
dadd136ae1 Use constants for datatype sizes
git-svn-id: svn://svn.cc65.org/cc65/trunk@1480 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-11-02 12:39:10 +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
4389b0c438 Fixed a small bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@1426 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-10-03 09:00:57 +00:00
cuz
257005696f Improve type casts for ints.
Allow the second and third operand of the :? operator to be of type int.


git-svn-id: svn://svn.cc65.org/cc65/trunk@1395 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-09-18 20:14:51 +00:00
cuz
8d8458032d Fixed a bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@1371 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-07-26 19:27:55 +00:00
cuz
02c26efdd3 Replace calls to memset with _bzero if the fill value is zero and -Oi in
effect.


git-svn-id: svn://svn.cc65.org/cc65/trunk@1359 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-07-16 11:01:51 +00:00
cuz
7c9bf720d8 Fixed a bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@1350 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-07-12 08:45:42 +00:00