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

129 Commits

Author SHA1 Message Date
uz
9127774a4d Pass a complete ExprDesc and not just the Flags field to GlobalModeFlags to
allow for better debugging (output) in case of problems.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3879 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-05 21:11:26 +00:00
uz
dbb9a31fd9 Fixed wrong code generation for
((unsigned char *)(&shadow))[reg & 0x0f] = value;


git-svn-id: svn://svn.cc65.org/cc65/trunk@3875 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-05 19:47:57 +00:00
uz
3482a9e7ce Fixed a comment
git-svn-id: svn://svn.cc65.org/cc65/trunk@3868 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-03 20:09:03 +00:00
cuz
52c0c284da Calling an undefined function is an error in C99.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3857 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-07-31 18:30:33 +00:00
cuz
10c949062b Fixed a bug: The compiler evaluated constant expressions internally always
using signed integers as data types. This led to wrong results for mod, div
and compares.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3797 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-08-26 18:53:46 +00:00
cuz
80a4c8c02b Fix type of "&array" - it will actually generate pointer to array, not pointer
to element. This will make some valid code work but emits now errors for
questionable code.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3775 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-03-18 19:15:35 +00:00
cuz
9601baf6ec Fixed internal compiler error on invalid input code.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3768 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-02-03 18:11:37 +00:00
cuz
eb745b3d1b Fixed a problem with undefined identifiers in #if expressions: If the
identifier is not the last token on the line, the compiler will run into
an error.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3744 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-05-29 20:38:44 +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
64921852dd Parse the C99 "restrict" keyword correctly (but ignore it otherwise).
git-svn-id: svn://svn.cc65.org/cc65/trunk@3706 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-02-17 20:19:35 +00:00
cuz
e4ec9014d2 Reversed accidentally checked in changes
git-svn-id: svn://svn.cc65.org/cc65/trunk@3613 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-08-31 21:49:12 +00:00
cuz
d6c50c1826 Added HuC6280 cpu (will be treated as a 65C02)
git-svn-id: svn://svn.cc65.org/cc65/trunk@3612 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-08-31 21:48:08 +00:00
cuz
c218639977 Fixed a bug: The compiler aborted with an internal error if a non function
was called as a function after printing the diagnostic.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3526 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-07-17 09:49:34 +00:00
cuz
b01c0cf2b7 Fixed a bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@3511 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-05-11 13:54:22 +00:00
cuz
e06d9d0d84 Fixed a bug (hopefully).
The ArrayRef() does really need a rewrite, now since we have better
expression info.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3364 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-01-09 21:17:19 +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
366d066375 Fixed the last fix
git-svn-id: svn://svn.cc65.org/cc65/trunk@3171 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-08-02 17:19:52 +00:00
cuz
123677c802 In a function call for all parameters not covered by a prototype, convert
arrays to pointer to first element, and functions to pointer to function.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3169 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-08-02 16:39:55 +00:00
cuz
104f041111 Add dummy return value to avoid a wcc warning
git-svn-id: svn://svn.cc65.org/cc65/trunk@3162 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-07-17 22:16:02 +00:00
cuz
0ba074995c Check for invalid function names before trying to compare the name against
the names of known standard functions.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3154 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-07-11 13:47:57 +00:00
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