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

63 Commits

Author SHA1 Message Date
laubzega
c797b3b376 Proper warnings for "risky" gotos. 2018-10-02 18:49:53 +02:00
Laubzega
a4b6bb63c0 Minor changes after review. 2018-10-02 18:49:53 +02:00
Laubzega
581c46c213 Add checks for risky goto statements. 2018-10-02 18:49:53 +02:00
Greg King
1aab287189 Fixed the handling of "while (0) {}".
It's a corner case; but, conditional macroes might create it -- better safe than sorry.
2017-04-07 09:26:58 -04: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
212941ddb4 Fix consecutive false errors when a label without a following statement is
encountered.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4894 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-12-30 19:30:54 +00:00
uz
e048d2aeba Make the warning "statement has no effect" switchable.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4823 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-10-02 19:32:11 +00:00
uz
48c647b6bd Added while loop inversion.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4642 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-04-17 15:19:35 +00:00
uz
85f96a7d6f Fixed warnings generated by clang (run by Per Olofsson).
git-svn-id: svn://svn.cc65.org/cc65/trunk@4255 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-28 15:59:18 +00:00
uz
32e2eb3fad Fixed parsing a labeled-statement: A label is always part of a statement, it
is not itself one.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4166 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-13 14:36:16 +00:00
uz
84710f7227 Remember more function infos in the Function struct.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4104 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-31 20:37:54 +00:00
uz
0a9c7484ad Add a warning if a function returning something does not contain a return
statement.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4095 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-31 13:18:49 +00:00
cuz
357118697d A label must always be followed by a statement. Check for this.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3860 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-01 20:00:23 +00:00
cuz
64ec376140 Switch statement may now contain arbitrary code as the standard requires. The
compiler will now accept stuff like Duffs device.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3859 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-01 19:44:01 +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
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
eb388aa237 The loop code will access the stackpointer directly
git-svn-id: svn://svn.cc65.org/cc65/trunk@3106 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-06-06 10:52:32 +00:00
cuz
08eb9b7b0e Check for and warn on statements that don't have an effect
git-svn-id: svn://svn.cc65.org/cc65/trunk@3097 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-06-05 12:56:51 +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
cb8c3746f5 A continue statement within a do loop did not work. Cleaned up the loop
code a little bit.


git-svn-id: svn://svn.cc65.org/cc65/trunk@2722 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-12-09 16:29:59 +00:00
cuz
d4bd299b5c Fixed a bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@2459 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-09-30 14:40:32 +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
c8d76046cb Added better error recovery
git-svn-id: svn://svn.cc65.org/cc65/trunk@2013 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-03-13 12:35:54 +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
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
a96da498f5 Renamed the functions working with "struct Function".
Fixed a problem with K&R functions: In a function with no return type
specified, the compiler did not allow a simple "return" statement. However,
there was no "void" type at that time, so it was not possible to specify
something else. The solution is to allow omission of a return value in a
K&R function with an implicit int type. Other types or an explicit int is
still checked.


git-svn-id: svn://svn.cc65.org/cc65/trunk@1302 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-06-12 12:12:04 +00:00
cuz
1483fa741a Small change to make line info more exact
git-svn-id: svn://svn.cc65.org/cc65/trunk@1048 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-10-13 09:20:26 +00:00
cuz
41d2cc8f91 Rewrote the switch statement
git-svn-id: svn://svn.cc65.org/cc65/trunk@1021 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-10-11 08:02:03 +00:00
cuz
88dfee5642 Module breakup
git-svn-id: svn://svn.cc65.org/cc65/trunk@1017 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-10-09 09:44:39 +00:00
cuz
8cd7b15c8b Squashed one more bug in the switch statement
git-svn-id: svn://svn.cc65.org/cc65/trunk@816 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-07-24 20:19:03 +00:00
cuz
d982999f3e Fixed another bug in CascadeSwitch
git-svn-id: svn://svn.cc65.org/cc65/trunk@814 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-07-24 20:12:53 +00:00
cuz
c5ccad1fc7 Fixed a bug in CascadeSwitch
git-svn-id: svn://svn.cc65.org/cc65/trunk@813 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-07-24 20:08:58 +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
e370e447f6 Fixed a while loop bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@803 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-07-17 17:18:07 +00:00
cuz
6c34eeb93d Move the increment code of a for loop after the loop body.
git-svn-id: svn://svn.cc65.org/cc65/trunk@799 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-07-17 12:50:38 +00:00
cuz
034a4b75e5 Optimizer bugfixes, polished the line info.
git-svn-id: svn://svn.cc65.org/cc65/trunk@761 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-05-26 10:58:40 +00:00
cuz
916a0879d5 cleanup
git-svn-id: svn://svn.cc65.org/cc65/trunk@760 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-05-26 10:04:15 +00:00
cuz
3a272d93af More polishing to get the line info right
git-svn-id: svn://svn.cc65.org/cc65/trunk@742 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-05-22 16:54:47 +00:00
cuz
12ec031f9a Polishing and minor corrections
git-svn-id: svn://svn.cc65.org/cc65/trunk@741 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-05-22 13:58:56 +00:00
cuz
0e80187cec Added the lineinfo module. Changed the complete code generation to use the
supplied data structures. Re-added the -T option which is much more exact
now because of the better line info stuff.
Cleanups in the scanner (remove old #defines).


git-svn-id: svn://svn.cc65.org/cc65/trunk@740 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-05-22 09:32:24 +00:00
cuz
c1b6680a92 Working
git-svn-id: svn://svn.cc65.org/cc65/trunk@737 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-05-21 06:43:46 +00:00
cuz
8a3bacd7f4 Working on the new backend
git-svn-id: svn://svn.cc65.org/cc65/trunk@707 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-05-03 20:16:41 +00:00