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

63 Commits

Author SHA1 Message Date
Greg King
a6b04f6e97 Changed most "backticks" (grave accents) into apostrophes.
Quotations that are embraced by tick marks now look better, in most fonts.
2019-01-05 14:57:12 -05:00
Greg King
d3ccc289c1 Stopped cc65 from putting redundant .segment directives into its Assembly output. 2017-06-16 21:53:50 -04:00
Oliver Schmidt
02daf9f8b5 So far the built-in inlining of several known standard function was always (!) enabled and the option -Os enabled additional, potentially unsafe inlining of some of those functions.
There were two aspects of this behavior that were considered undesirable:
- Although the safe inlining is in general desirable it should only be enabled if asked for it - like any other optimization.
- The option name -Os implies that it is a safe option, the potentially unsafe inlining should have a more explicit name.

So now:
- The option -Os enables the safe inlining.
- The new option --eagerly-inline-funcs enables the potentially unsafe inlining (including the safe inlining).

Additionally was added:
- The option --inline-stdfuncs that does like -Os enable the safe inlining but doesn't enable optimizations.
- The pragma inline-stdfuncs that works identical to --inline-stdfuncs.
- The pragma allow-eager-inline that enables the potentially unsafe inlining but doesn't include the safe inlining. That means that by itself it only marks code as safe for potentially unsafe inlining but doesn't actually enable any inlining.
2017-04-03 23:20:26 +02:00
Piotr Fusik
8e35a82c91 Fix regression of #pragma bss-name
Closes #409
2017-03-21 22:35:25 +01:00
Piotr Fusik
5988ec37cd Revert "Disallow global variable declarations with an initializer."
This reverts commit 1f12a06f7c.
2017-02-15 18:51:27 +01:00
Piotr Fusik
31f19fbc65 Issue an error for duplicate global variables.
Previously it was an assembler error.
2017-02-13 21:10:21 +01:00
Piotr Fusik
730d01a25f Global uninitialized variable is only a tentative definition.
Closes #204
2017-02-13 21:04:45 +01:00
Piotr Fusik
1f12a06f7c Disallow global variable declarations with an initializer.
E.g.
extern int i = 42;
2017-02-13 19:41:05 +01: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
fd679d92d0 Fixed a problem: When a struct or unit was declared with a tag name, it was
possible to use the opposite type with the tag name. That is "struct a" after
declaring "union a" and vice versa.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5980 b7a2c559-68d2-44c3-8de9-860c34a00d81
2013-02-02 22:31:26 +00:00
uz
724d1b9160 Fixed an error: When determining where to place initialized data, the compiler
didn't look "deep enough" into nested arrays to determine the constness
correctly.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5622 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-03-24 14:28:59 +00:00
uz
49c457f518 Disallow __asm__ on global level.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5303 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-11-07 21:25:20 +00:00
uz
8fc851b338 Write out global symbols to the debug file. Added some fixes for unusual
situations (extern symbols without attached import, because the import wasn't
referenced and therefore removed by the assembler).


git-svn-id: svn://svn.cc65.org/cc65/trunk@5290 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-08-31 20:48:40 +00:00
uz
172d33e584 Fixed problem with last change: Static declaration do also set the SC_EXTERN
flag (have to check why).


git-svn-id: svn://svn.cc65.org/cc65/trunk@4818 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-24 07:28:08 +00:00
uz
5aff0764a1 Allow initialization of variables declared with "extern".
git-svn-id: svn://svn.cc65.org/cc65/trunk@4816 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-23 18:18:53 +00:00
uz
7d94dc50a1 New option and #pragma --local-strings that causes string literals to be
output immediately.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4504 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-12-08 20:35:24 +00:00
uz
3976746735 Rewrote literal handling. Literals are now saved together with other function
data, and at the end of compilation merged if possible. Literals for unused
functions are removed together with the function.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4501 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-12-05 22:39:45 +00:00
uz
1f90ec93a0 Move global segment creation to a better place in source.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4498 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-12-04 13:04:40 +00:00
uz
548336a7bd Renamed attribute handling functions. Added SymHasAttr().
git-svn-id: svn://svn.cc65.org/cc65/trunk@4375 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-19 10:19:26 +00:00
uz
5a00b38aab Fixed the existing but unused attribute parsing code. Added
__attribute__((noexit)) that may be used to mark functions that won't return.
Added this attribute to the exit() function in stdlib.h.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4372 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-18 18:31:02 +00:00
uz
07c25db768 Added the __STDC_HOSTED__ macro.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4349 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-08 15:00:25 +00:00
uz
7b847321a8 Move the version numbers from the interface of the version module into a new
implementation. Allow for release candidates to be specified and disinguished.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4260 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-28 20:10:01 +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
d0c4f85e51 Fix wrong check for typedef which caused non allocation of storage for structs
after the latest changes.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4074 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-29 19:05:01 +00:00
uz
4a93f188a0 Fixed a bug reported by Greg King: Initialized data for constant arrays was
not placed in the RODATA but in the DATA segment.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4044 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-20 10:55:38 +00:00
uz
82b998117a Added a separate output module that is used to manage the output file.
Fixed the -E switch: Output was always sent to stdout and an empty assembler
output file was generated. Now the output is sent to either <inputstem>.i or
the file named in the -o option.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3955 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-02-23 21:25:59 +00:00
uz
a1d7fed128 Fixed several problems with old style (K&R) declarations and a mix of old and
new style decls.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3869 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-03 20:55:36 +00:00
uz
24c6e1ce5b Move some storage class handling and checking for implicit into from locals.c
and compile.c into ParseDecl() (declare.c).


git-svn-id: svn://svn.cc65.org/cc65/trunk@3867 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-03 18:20:12 +00:00
uz
841ea0e686 Transfer the storage class flags from struct DeclSpec into struct Declaration.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3866 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-03 18:00:05 +00:00
uz
c76a8657b3 Fixed handling of function definitions with an empty parameter list. According
to the standard, an empty parameter list in a function declarator that is not
a definition means that the function may have any number of parameters. In a
function definition, it means that there are no parameters (as if the function
were declared with a "void" parameter list).


git-svn-id: svn://svn.cc65.org/cc65/trunk@3865 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-03 15:30:03 +00:00
cuz
5c1bc2d740 Output warnings for implicit int types if std >= C99.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3361 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-01-09 18:03:55 +00:00
cuz
ae70828938 Some improvements using the new SB_Printf for string buffers
git-svn-id: svn://svn.cc65.org/cc65/trunk@3335 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-12-16 22:43:52 +00:00
cuz
06b57e6e7e Introduce a -E flag that activates just the preprocessor.
Use variable sized string buffers for input and macro processing instead
of the fixed buffers used before.
Many changes in the preprocessor to make it more standards compliant (which
it is still not).


git-svn-id: svn://svn.cc65.org/cc65/trunk@3182 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-09-16 12:42:41 +00:00
cuz
13a2927e17 The -A and --ansi switches are gone, together with the __STRICT_ANSI__
predefined macro. Instead there is now a command line option --standard that
allows to set c89, c99 or cc65 as language standard. The compiler defines a
macro __CC65_STD__ that is one of __CC65_STD_C89__, __CC65_STD_C99__ or
__CC65_STD_CC65__ depending on the command line option. Default is cc65 (all
extensions) as before.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3133 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-06-21 22:22:11 +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
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
b821c2c8ae More optimizations
git-svn-id: svn://svn.cc65.org/cc65/trunk@2305 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-08-13 09:35:49 +00:00
cuz
9aa85743ba Fixed an include file search order problem
git-svn-id: svn://svn.cc65.org/cc65/trunk@2173 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-05-27 21:48:05 +00:00
cuz
f80a5148bd Fixed problem with array forward decl
git-svn-id: svn://svn.cc65.org/cc65/trunk@1994 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-02-19 22:58:13 +00:00
cuz
6e6560abd9 Fixed the last fix. Sigh:-(
git-svn-id: svn://svn.cc65.org/cc65/trunk@1909 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-01-20 21:02:57 +00:00
cuz
4ca598de3a Fixed the last fix. Sigh:-(
git-svn-id: svn://svn.cc65.org/cc65/trunk@1908 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-01-20 20:53:42 +00:00
cuz
638f54f3e4 The check for illegal storage classes on globals was wrong
git-svn-id: svn://svn.cc65.org/cc65/trunk@1907 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-01-20 06:02:33 +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
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
49fd7134e5 Fixed a buffer overflow (report from Christian Groessler).
git-svn-id: svn://svn.cc65.org/cc65/trunk@1464 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-10-14 16:23:26 +00:00
cuz
7215ebd145 Added the __DATE__ and __TIME__ preprocessor macros
git-svn-id: svn://svn.cc65.org/cc65/trunk@1403 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-09-23 21:37:15 +00:00
cuz
56b8ead112 Move inline asm parsing into a separate module
git-svn-id: svn://svn.cc65.org/cc65/trunk@880 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-09-09 09:33:06 +00:00
cuz
e1b0251f04 Renamed some functions for better readbility.
Add a binary search for preprocessor tokens (instead of the old linear one)
to speed up the compiler.


git-svn-id: svn://svn.cc65.org/cc65/trunk@857 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-09-06 10:17:52 +00:00