cparser
15 years agoMore work for C++ mode:
Matthias Braun [Fri, 14 Nov 2008 15:34:32 +0000 (15:34 +0000)]
More work for C++ mode:

* Can parse (but not produce usefull code) for namespace now
* mangle function names according to Itanium C++ ABI
* Parse custom linkage for function types

[r23661]

15 years agoTeach cparser how to parse (f)(void);, i.e. global declarations can start with a (.
Christoph Mallon [Fri, 14 Nov 2008 15:16:27 +0000 (15:16 +0000)]
Teach cparser how to parse (f)(void);, i.e. global declarations can start with a (.

[r23658]

15 years agodelete temp files
Matthias Braun [Fri, 14 Nov 2008 12:55:25 +0000 (12:55 +0000)]
delete temp files

[r23653]

15 years agomore cleanup
Matthias Braun [Fri, 14 Nov 2008 12:40:15 +0000 (12:40 +0000)]
more cleanup

[r23651]

15 years agouse ushort wchar_t on mingw
Matthias Braun [Fri, 14 Nov 2008 12:37:57 +0000 (12:37 +0000)]
use ushort wchar_t on mingw

[r23650]

15 years agomissing break
Matthias Braun [Fri, 14 Nov 2008 12:36:23 +0000 (12:36 +0000)]
missing break

[r23649]

15 years agomost of the options are handled in main.c now
Matthias Braun [Fri, 14 Nov 2008 12:35:45 +0000 (12:35 +0000)]
most of the options are handled in main.c now

[r23648]

15 years ago- Try to move OS/target specific stuff to lang_features.h and main.c
Matthias Braun [Fri, 14 Nov 2008 12:34:35 +0000 (12:34 +0000)]
- Try to move OS/target specific stuff to lang_features.h and main.c
- In this case: initialize types in types.c and set stuff like short_wchar
  in main

[r23647]

15 years agofix local labels
Matthias Braun [Thu, 13 Nov 2008 14:02:44 +0000 (14:02 +0000)]
fix local labels

[r23632]

15 years agopass correct modes to 64bit lowerer
Matthias Braun [Thu, 13 Nov 2008 13:36:42 +0000 (13:36 +0000)]
pass correct modes to 64bit lowerer

[r23626]

15 years agono need for a separate local_label stack, the scoping rules are exactly the same...
Matthias Braun [Thu, 13 Nov 2008 12:36:22 +0000 (12:36 +0000)]
no need for a separate local_label stack, the scoping rules are exactly the same as for the normal environment_stack

[r23622]

15 years agoavoid warnings and fix potential bugs (if someone manages to get a % into a function...
Matthias Braun [Thu, 13 Nov 2008 11:23:04 +0000 (11:23 +0000)]
avoid warnings and fix potential bugs (if someone manages to get a % into a function name

[r23615]

15 years agofix assert
Matthias Braun [Thu, 13 Nov 2008 10:26:42 +0000 (10:26 +0000)]
fix assert

[r23612]

15 years agoc frontend doesn't case about modulo_shift, rename modes to uppercase so it dumps...
Matthias Braun [Tue, 11 Nov 2008 19:56:32 +0000 (19:56 +0000)]
c frontend doesn't case about modulo_shift, rename modes to uppercase so it dumps nicer

[r23580]

15 years agoIn C++ the result type of !, <, <=, >=, >, == and != is bool.
Christoph Mallon [Mon, 10 Nov 2008 09:38:26 +0000 (09:38 +0000)]
In C++ the result type of !, <, <=, >=, >, == and != is bool.

[r23539]

15 years agoParse C++ bool, false and true.
Christoph Mallon [Mon, 10 Nov 2008 09:23:31 +0000 (09:23 +0000)]
Parse C++ bool, false and true.

[r23538]

15 years agomore work towards expansion of macros with arguments
Matthias Braun [Fri, 7 Nov 2008 08:18:40 +0000 (08:18 +0000)]
more work towards expansion of macros with arguments

[r23505]

15 years ago- renamed option end-melt to shape-blocks
Michael Beck [Thu, 6 Nov 2008 15:09:52 +0000 (15:09 +0000)]
- renamed option end-melt to shape-blocks
- let the switch lowerer run after the block shaper

[r23490]

15 years agoWhen creating an error typedef, set its type to the error type, so nobody encounters...
Christoph Mallon [Tue, 4 Nov 2008 15:00:36 +0000 (15:00 +0000)]
When creating an error typedef, set its type to the error type, so nobody encounters a null pointer later on.

[r23434]

15 years agoDo not panic, when finding a typedef name, when an expression is expected.
Christoph Mallon [Tue, 4 Nov 2008 14:51:53 +0000 (14:51 +0000)]
Do not panic, when finding a typedef name, when an expression is expected.

[r23433]

15 years agouse expect() to find the ] of an array access expression.
Christoph Mallon [Tue, 4 Nov 2008 14:37:49 +0000 (14:37 +0000)]
use expect() to find the ] of an array access expression.

[r23432]

15 years agoSet the source position in allocate_expression_zero().
Christoph Mallon [Tue, 4 Nov 2008 14:34:01 +0000 (14:34 +0000)]
Set the source position in allocate_expression_zero().

[r23431]

15 years agoTell the ast printer a thing ot two about EXPR_REFERENCE_ENUM_VALUE.
Christoph Mallon [Tue, 4 Nov 2008 14:28:10 +0000 (14:28 +0000)]
Tell the ast printer a thing ot two about EXPR_REFERENCE_ENUM_VALUE.

[r23430]

15 years agofix parsing of define argument lists, fix subtle problems with first token of include...
Matthias Braun [Tue, 4 Nov 2008 10:04:31 +0000 (10:04 +0000)]
fix parsing of define argument lists, fix subtle problems with first token of included file not expanded, fix skip_spaces ignoring comments

[r23425]

15 years agomodifier to print preprocessing token
Matthias Braun [Tue, 4 Nov 2008 10:03:34 +0000 (10:03 +0000)]
modifier to print preprocessing token

[r23424]

15 years agoprint tokens without surrounding ''
Matthias Braun [Tue, 4 Nov 2008 10:03:12 +0000 (10:03 +0000)]
print tokens without surrounding ''

[r23423]

15 years agomore tricky preprocessor problems
Matthias Braun [Tue, 4 Nov 2008 09:43:14 +0000 (09:43 +0000)]
more tricky preprocessor problems

[r23421]

15 years agoif(n)def implementation
Matthias Braun [Mon, 3 Nov 2008 16:25:11 +0000 (16:25 +0000)]
if(n)def implementation

[r23414]

15 years agoimplemented #include
Matthias Braun [Mon, 3 Nov 2008 01:22:50 +0000 (01:22 +0000)]
implemented #include

[r23399]

15 years agoadd beginnings of preprocessor code (and ugly hack to activate it) to svn
Matthias Braun [Sun, 2 Nov 2008 16:58:26 +0000 (16:58 +0000)]
add beginnings of preprocessor code (and ugly hack to activate it) to svn

[r23396]

15 years agoEXPR_INVALID gets constructed in case of errors
Matthias Braun [Sun, 2 Nov 2008 16:36:26 +0000 (16:36 +0000)]
EXPR_INVALID gets constructed in case of errors

[r23392]

15 years agoimprove flexible array member handling, assign error_type to error_entity
Matthias Braun [Sun, 2 Nov 2008 16:33:58 +0000 (16:33 +0000)]
improve flexible array member handling, assign error_type to error_entity

[r23390]

15 years agoset has_implicit_size flag
Matthias Braun [Sun, 2 Nov 2008 14:41:31 +0000 (14:41 +0000)]
set has_implicit_size flag

[r23385]

15 years agoTODO update
Matthias Braun [Sun, 2 Nov 2008 11:44:30 +0000 (11:44 +0000)]
TODO update

[r23382]

15 years agoMove more C tests
Matthias Braun [Sat, 1 Nov 2008 19:18:58 +0000 (19:18 +0000)]
Move more C tests

[r23372]

15 years agomove C frontend tests
Matthias Braun [Sat, 1 Nov 2008 19:18:31 +0000 (19:18 +0000)]
move C frontend tests

[r23371]

15 years agoadd main, fix warnings not intended
Matthias Braun [Sat, 1 Nov 2008 17:39:06 +0000 (17:39 +0000)]
add main, fix warnings not intended

[r23357]

15 years agothis should not be here
Matthias Braun [Sat, 1 Nov 2008 17:32:22 +0000 (17:32 +0000)]
this should not be here

[r23356]

15 years agowrite a testapp that really test functionality (so we can actually detect the impleme...
Matthias Braun [Sat, 1 Nov 2008 17:20:48 +0000 (17:20 +0000)]
write a testapp that really test functionality (so we can actually detect the implementation bugs)

[r23355]

15 years agolocal labels should be fixed
Matthias Braun [Sat, 1 Nov 2008 17:12:31 +0000 (17:12 +0000)]
local labels should be fixed

[r23354]

15 years agopartly fix local labels, %P already prints %P an at no need for additional ones in...
Matthias Braun [Sat, 1 Nov 2008 17:11:17 +0000 (17:11 +0000)]
partly fix local labels, %P already prints %P an at no need for additional ones in the messages

[r23353]

15 years agoconditional expressions true case may be NULL as a GNU extension
Matthias Braun [Sat, 1 Nov 2008 17:05:58 +0000 (17:05 +0000)]
conditional expressions true case may be NULL as a GNU extension

[r23352]

15 years agodeclaration_t -> entity_t
Matthias Braun [Sat, 1 Nov 2008 17:00:35 +0000 (17:00 +0000)]
declaration_t -> entity_t
This breaks up the monotolithic declaration_t monster in a bunch of different
structs like variable_t, function_t or label_t
Not everything back to the way it was, but SPEC seems to work now. Just some obscure gnu extensions missing.

[r23351]

15 years agofix warning
Matthias Braun [Sat, 1 Nov 2008 16:55:14 +0000 (16:55 +0000)]
fix warning

[r23349]

15 years agothis is a gnu extension I guess
Matthias Braun [Sat, 1 Nov 2008 15:45:01 +0000 (15:45 +0000)]
this is a gnu extension I guess

[r23348]

15 years agotest implicit type for k&r functions
Matthias Braun [Sat, 1 Nov 2008 15:17:47 +0000 (15:17 +0000)]
test implicit type for k&r functions

[r23347]

15 years ago- add option -end-melt
Michael Beck [Tue, 28 Oct 2008 15:54:18 +0000 (15:54 +0000)]
- add option -end-melt

[r23282]

15 years ago- further fixed r23189
Michael Beck [Mon, 27 Oct 2008 18:03:02 +0000 (18:03 +0000)]
- further fixed r23189

[r23242]

15 years agoFix anchor token underflow while parsing for-statements.
Christoph Mallon [Mon, 27 Oct 2008 15:44:09 +0000 (15:44 +0000)]
Fix anchor token underflow while parsing for-statements.

[r23236]

15 years agoParse sizeof(T){...} correctly, i.e. not sizeof type, but sizeof expression starting...
Christoph Mallon [Mon, 27 Oct 2008 15:40:15 +0000 (15:40 +0000)]
Parse sizeof(T){...} correctly, i.e. not sizeof type, but sizeof expression starting with a compound literal.

[r23234]

15 years agoAdd the C++ :: token.
Christoph Mallon [Mon, 27 Oct 2008 12:17:13 +0000 (12:17 +0000)]
Add the C++ :: token.

[r23226]

15 years agoParse and check semantic of delete expressions.
Christoph Mallon [Mon, 27 Oct 2008 11:40:23 +0000 (11:40 +0000)]
Parse and check semantic of delete expressions.

[r23225]

15 years agoC++ banned implicit int.
Christoph Mallon [Mon, 27 Oct 2008 11:08:09 +0000 (11:08 +0000)]
C++ banned implicit int.

[r23224]

15 years agoC++ does not allow assignment from a void pointer type to a non-void pointer type.
Christoph Mallon [Mon, 27 Oct 2008 11:00:18 +0000 (11:00 +0000)]
C++ does not allow assignment from a void pointer type to a non-void pointer type.

[r23223]

15 years agoC++ has not "tentative definitions".
Christoph Mallon [Mon, 27 Oct 2008 10:50:48 +0000 (10:50 +0000)]
C++ has not "tentative definitions".

[r23222]

15 years agoC++ function declarations with an empty parameter list denote no parameters instead...
Christoph Mallon [Mon, 27 Oct 2008 10:46:15 +0000 (10:46 +0000)]
C++ function declarations with an empty parameter list denote no parameters instead of unspecified parameters.

[r23221]

15 years agoParse and check semantic of throw expressions.
Christoph Mallon [Mon, 27 Oct 2008 10:32:09 +0000 (10:32 +0000)]
Parse and check semantic of throw expressions.

[r23220]

15 years agoRemove if, whose condition is never true.
Christoph Mallon [Mon, 27 Oct 2008 06:48:38 +0000 (06:48 +0000)]
Remove if, whose condition is never true.

[r23219]

15 years agoIn C++ (most) character literals are of type char.
Christoph Mallon [Sun, 26 Oct 2008 20:55:23 +0000 (20:55 +0000)]
In C++ (most) character literals are of type char.

[r23218]

15 years agoAdd C++ keywords.
Christoph Mallon [Sun, 26 Oct 2008 20:38:34 +0000 (20:38 +0000)]
Add C++ keywords.

[r23217]

15 years agoFirst bit of C++ support: Different precedence for ?:.
Christoph Mallon [Sun, 26 Oct 2008 19:49:53 +0000 (19:49 +0000)]
First bit of C++ support: Different precedence for ?:.

[r23216]

15 years agoAdd support for C++ in the compiler driver.
Christoph Mallon [Sun, 26 Oct 2008 19:48:46 +0000 (19:48 +0000)]
Add support for C++ in the compiler driver.

[r23215]

15 years agomore tests
Matthias Braun [Sun, 26 Oct 2008 18:44:46 +0000 (18:44 +0000)]
more tests

[r23214]

15 years agoslightly improve testcase
Matthias Braun [Sun, 26 Oct 2008 18:04:37 +0000 (18:04 +0000)]
slightly improve testcase

[r23213]

15 years agoConsistently name the directories should_*.
Christoph Mallon [Sun, 26 Oct 2008 17:54:17 +0000 (17:54 +0000)]
Consistently name the directories should_*.

[r23212]

15 years agocp_error050: sizeof a compound literal.
Christoph Mallon [Sun, 26 Oct 2008 17:50:49 +0000 (17:50 +0000)]
cp_error050: sizeof a compound literal.

[r23211]

15 years agoFix parsing of expression statements, which pointlessly start with sizeof or __aligno...
Christoph Mallon [Sun, 26 Oct 2008 17:46:08 +0000 (17:46 +0000)]
Fix parsing of expression statements, which pointlessly start with sizeof or __alignof__, and sort the case list.

[r23210]

15 years agofix typo
Matthias Braun [Sun, 26 Oct 2008 12:26:06 +0000 (12:26 +0000)]
fix typo

[r23207]

15 years agothis was not meant to be here
Matthias Braun [Sun, 26 Oct 2008 12:23:44 +0000 (12:23 +0000)]
this was not meant to be here

[r23206]

15 years agoChange -w so that warnings can be activated again later on.
Christoph Mallon [Sun, 26 Oct 2008 12:11:03 +0000 (12:11 +0000)]
Change -w so that warnings can be activated again later on.

[r23205]

15 years agomore warning testcases
Matthias Braun [Sun, 26 Oct 2008 12:02:46 +0000 (12:02 +0000)]
more warning testcases

[r23204]

15 years agosource-position doesn't make any sense for types:
Matthias Braun [Sun, 26 Oct 2008 10:03:16 +0000 (10:03 +0000)]
source-position doesn't make any sense for types:
- atomic, pointer, function types are used throughout the program and always
  defined "on-the-fly" it's not possible to assign a correct source_position
- for struct, union and enum types we have to create a declaration_t anyway
  so they can get referenced by their name. In this case we can and should
  use the source_position of the declaration

[r23203]

15 years agoPrefix operators need no precedence.
Christoph Mallon [Sun, 26 Oct 2008 08:30:31 +0000 (08:30 +0000)]
Prefix operators need no precedence.

[r23201]

15 years ago- crashes, but should give an error
Michael Beck [Sun, 26 Oct 2008 02:04:06 +0000 (02:04 +0000)]
- crashes, but should give an error

[r23200]

15 years ago- BugFix: gcc optimizes def_nr + 1 < 0 away, arg\!
Michael Beck [Sun, 26 Oct 2008 00:24:57 +0000 (00:24 +0000)]
- BugFix: gcc optimizes def_nr + 1 < 0 away, arg\!

[r23196]

15 years ago- BugFix: generation of default case number was completely broken
Michael Beck [Sun, 26 Oct 2008 00:08:44 +0000 (00:08 +0000)]
- BugFix: generation of default case number was completely broken

[r23195]

15 years ago- fixed r23189: the AST-printer doubles the precesion to have one free
Michael Beck [Sat, 25 Oct 2008 22:37:06 +0000 (22:37 +0000)]
- fixed r23189: the AST-printer doubles the precesion to have one free
  bit for right-to-left handling

[r23194]

15 years agoUnify the precedence lists of the parser and the AST printer.
Christoph Mallon [Sat, 25 Oct 2008 20:06:26 +0000 (20:06 +0000)]
Unify the precedence lists of the parser and the AST printer.

[r23189]

15 years agoimproved switch.c
Matthias Braun [Sat, 25 Oct 2008 19:42:22 +0000 (19:42 +0000)]
improved switch.c

[r23188]

15 years agoReplace magic numbers for expression precedences by an enum. Do not unnecessarily...
Christoph Mallon [Sat, 25 Oct 2008 19:26:26 +0000 (19:26 +0000)]
Replace magic numbers for expression precedences by an enum.  Do not unnecessarily pass the precedence to the expression parsers.

[r23184]

15 years agoget rid of some fields in ast_t: outer_fkt_jmp, is_outer_ref, is_parameter
Matthias Braun [Sat, 25 Oct 2008 17:10:15 +0000 (17:10 +0000)]
get rid of some fields in ast_t: outer_fkt_jmp, is_outer_ref, is_parameter

[r23181]

15 years agoFix some precedence stuff for expression parsing.
Christoph Mallon [Sat, 25 Oct 2008 17:01:13 +0000 (17:01 +0000)]
Fix some precedence stuff for expression parsing.

[r23180]

15 years agosome testcases I had lying around here
Matthias Braun [Sat, 25 Oct 2008 14:44:06 +0000 (14:44 +0000)]
some testcases I had lying around here

[r23179]

15 years agoWhile our semantics of _Bool are wrong, at least make it the right size (for most...
Christoph Mallon [Fri, 24 Oct 2008 17:30:32 +0000 (17:30 +0000)]
While our semantics of _Bool are wrong, at least make it the right size (for most platforms).

[r23175]

15 years agoUse make_pointer_type().
Christoph Mallon [Fri, 24 Oct 2008 17:26:56 +0000 (17:26 +0000)]
Use make_pointer_type().

[r23174]

15 years agoasm_name is not used
Matthias Braun [Thu, 23 Oct 2008 21:59:02 +0000 (21:59 +0000)]
asm_name is not used

[r23149]

15 years agoskip_typeref().
Christoph Mallon [Tue, 21 Oct 2008 10:11:07 +0000 (10:11 +0000)]
skip_typeref().

[r23060]

15 years agoImprove unused variable check.
Christoph Mallon [Tue, 21 Oct 2008 08:13:29 +0000 (08:13 +0000)]
Improve unused variable check.

[r23059]

15 years agoImprove unused variable check.
Christoph Mallon [Tue, 21 Oct 2008 06:11:05 +0000 (06:11 +0000)]
Improve unused variable check.

[r23057]

15 years agoImplement a statement walker.
Christoph Mallon [Tue, 21 Oct 2008 06:07:12 +0000 (06:07 +0000)]
Implement a statement walker.

[r23056]

15 years agoRemove a variable, which was found by the new, shiny -Wunused-variable.
Christoph Mallon [Mon, 20 Oct 2008 10:47:54 +0000 (10:47 +0000)]
Remove a variable, which was found by the new, shiny -Wunused-variable.

[r23027]

15 years agoAnother attempt to solve the halting problem: Detect variables, which are never read...
Christoph Mallon [Mon, 20 Oct 2008 10:46:10 +0000 (10:46 +0000)]
Another attempt to solve the halting problem: Detect variables, which are never read.  The test is cheap and could be improved by using dataflow, SSA and fixpoint magic, but of course it is lightyears ahead of GCC.  For example in x = x + 1; x is not marked as read, because it is only used to assign to itself.

[r23026]

15 years agoMake check_unreachable() more tail recursion friendly.
Christoph Mallon [Mon, 20 Oct 2008 08:40:04 +0000 (08:40 +0000)]
Make check_unreachable() more tail recursion friendly.

[r23021]

15 years agoResolve assertion, when using -fsyntax-only.
Christoph Mallon [Mon, 20 Oct 2008 08:35:58 +0000 (08:35 +0000)]
Resolve assertion, when using -fsyntax-only.

[r23020]

15 years agoRemove stale (since r21011) comment.
Christoph Mallon [Sun, 19 Oct 2008 17:30:24 +0000 (17:30 +0000)]
Remove stale (since r21011) comment.

[r23016]

15 years agoFix r23014.
Christoph Mallon [Sun, 19 Oct 2008 17:25:56 +0000 (17:25 +0000)]
Fix r23014.

[r23015]

15 years agoDo not generate an error message about incompatible types in ?: if the error type...
Christoph Mallon [Sun, 19 Oct 2008 16:49:14 +0000 (16:49 +0000)]
Do not generate an error message about incompatible types in ?: if the error type is involved.

[r23014]

15 years agoResolve some warnings.
Christoph Mallon [Sun, 19 Oct 2008 16:42:19 +0000 (16:42 +0000)]
Resolve some warnings.

[r23013]

15 years agoAdd forgotten conversion specifiers.
Christoph Mallon [Sun, 19 Oct 2008 16:27:40 +0000 (16:27 +0000)]
Add forgotten conversion specifiers.

[r23012]

15 years agoResolve some warnings.
Christoph Mallon [Sun, 19 Oct 2008 16:19:50 +0000 (16:19 +0000)]
Resolve some warnings.

[r23011]