cparser
15 years agoincrease inline limit
Matthias Braun [Wed, 24 Sep 2008 14:50:51 +0000 (14:50 +0000)]
increase inline limit

[r22244]

15 years agoGenerate AST for some semantically invalid initializers.
Christoph Mallon [Tue, 23 Sep 2008 20:50:14 +0000 (20:50 +0000)]
Generate AST for some semantically invalid initializers.

[r22222]

15 years ago- add missing initialization of have_const_functions
Michael Beck [Tue, 23 Sep 2008 17:13:40 +0000 (17:13 +0000)]
- add missing initialization of have_const_functions

[r22214]

15 years agohandle DM_CONST, lower inline limit, force optimize_funccalls
Matthias Braun [Tue, 23 Sep 2008 14:57:08 +0000 (14:57 +0000)]
handle DM_CONST, lower inline limit, force optimize_funccalls

[r22210]

15 years agoTreat size_constant like a bool should be, i.e. do not explicitly compare with =...
Christoph Mallon [Tue, 23 Sep 2008 14:45:28 +0000 (14:45 +0000)]
Treat size_constant like a bool should be, i.e. do not explicitly compare with == 1/true.

[r22206]

15 years agodisable builtins by default
Matthias Braun [Tue, 23 Sep 2008 09:12:41 +0000 (09:12 +0000)]
disable builtins by default

[r22187]

15 years agopossibility to disable builtin functions
Matthias Braun [Mon, 22 Sep 2008 18:42:50 +0000 (18:42 +0000)]
possibility to disable builtin functions

[r22178]

15 years agomake -fsync default
Matthias Braun [Sun, 21 Sep 2008 22:48:19 +0000 (22:48 +0000)]
make -fsync default

[r22157]

15 years agoright_to_left() now returns 0 for left-to-right associativity instead of -1.
Christoph Mallon [Sat, 20 Sep 2008 12:17:52 +0000 (12:17 +0000)]
right_to_left() now returns 0 for left-to-right associativity instead of -1.

[r22138]

15 years agofix gcse
Matthias Braun [Fri, 19 Sep 2008 11:27:03 +0000 (11:27 +0000)]
fix gcse

[r22122]

15 years agoResolve off-by-one (and off-by-two) errors in the source position of statements.
Christoph Mallon [Fri, 19 Sep 2008 04:56:20 +0000 (04:56 +0000)]
Resolve off-by-one (and off-by-two) errors in the source position of statements.

[r22112]

15 years agoSet the source position in allocate_statement_zero().
Christoph Mallon [Fri, 19 Sep 2008 04:48:26 +0000 (04:48 +0000)]
Set the source position in allocate_statement_zero().

[r22111]

15 years agoMake stray ; outside of functions an error in strict mode.
Christoph Mallon [Thu, 18 Sep 2008 22:30:18 +0000 (22:30 +0000)]
Make stray ; outside of functions an error in strict mode.

[r22102]

15 years agoResolve compile error.
Christoph Mallon [Thu, 18 Sep 2008 22:29:34 +0000 (22:29 +0000)]
Resolve compile error.

[r22101]

15 years ago- BugFix: unitializer must be created using qualifiers from array-skipped typed
Michael Beck [Thu, 18 Sep 2008 19:17:54 +0000 (19:17 +0000)]
- BugFix: unitializer must be created using qualifiers from array-skipped typed

[r22092]

15 years ago- add get_type_qualifiers() allowing to get the type qualifiers WITHOUT
Michael Beck [Thu, 18 Sep 2008 19:17:11 +0000 (19:17 +0000)]
- add get_type_qualifiers() allowing to get the type qualifiers WITHOUT
  using skip_typeref() AND allowing to skip ARRAY types

[r22091]

15 years agoThe standard calls it "file scope", so rename global_scope to file_scope.
Christoph Mallon [Thu, 18 Sep 2008 13:03:31 +0000 (13:03 +0000)]
The standard calls it "file scope", so rename global_scope to file_scope.

[r22079]

15 years agoResolve unreachable statement warnings.
Christoph Mallon [Thu, 18 Sep 2008 11:52:46 +0000 (11:52 +0000)]
Resolve unreachable statement warnings.

[r22077]

15 years agoPut T_EOF into the anchor set.
Christoph Mallon [Thu, 18 Sep 2008 11:43:02 +0000 (11:43 +0000)]
Put T_EOF into the anchor set.

[r22075]

15 years agodepend on libfirm (if path is specified in config.mak)
Matthias Braun [Thu, 18 Sep 2008 11:15:36 +0000 (11:15 +0000)]
depend on libfirm (if path is specified in config.mak)

[r22074]

15 years agoSlightly simplify stack_pop_to().
Christoph Mallon [Thu, 18 Sep 2008 09:41:03 +0000 (09:41 +0000)]
Slightly simplify stack_pop_to().

[r22072]

15 years agoenvironment_top() and local_label_top() return size_t, not int.
Christoph Mallon [Thu, 18 Sep 2008 09:02:58 +0000 (09:02 +0000)]
environment_top() and local_label_top() return size_t, not int.

[r22070]

15 years agoSlightly simplify stack_push().
Christoph Mallon [Thu, 18 Sep 2008 08:53:45 +0000 (08:53 +0000)]
Slightly simplify stack_push().

[r22069]

15 years agofixed parameter redeclaration error
Michael Beck [Thu, 18 Sep 2008 00:32:53 +0000 (00:32 +0000)]
fixed parameter redeclaration error

[r22068]

15 years agoenhanced
Michael Beck [Thu, 18 Sep 2008 00:32:13 +0000 (00:32 +0000)]
enhanced

[r22067]

15 years ago- functions cannot be lvalues
Michael Beck [Thu, 18 Sep 2008 00:22:55 +0000 (00:22 +0000)]
- functions cannot be lvalues

[r22066]

15 years ago- add more attributes to support inner functions
Michael Beck [Thu, 18 Sep 2008 00:15:34 +0000 (00:15 +0000)]
- add more attributes to support inner functions
- preliminary support for code generation for inner functions (closure must NOT be used yet)

[r22065]

15 years ago- added outer function jump to example
Michael Beck [Thu, 18 Sep 2008 00:13:05 +0000 (00:13 +0000)]
- added outer function jump to example

[r22064]

15 years agoshould warn about struct inside parameter scope definition
Michael Beck [Wed, 17 Sep 2008 23:20:48 +0000 (23:20 +0000)]
should warn about struct inside parameter scope definition

[r22063]

15 years ago- replaced set_scope by scope_push()/scope_pop()
Michael Beck [Wed, 17 Sep 2008 21:52:36 +0000 (21:52 +0000)]
- replaced set_scope by scope_push()/scope_pop()
- detect access to variables of outer functions and set the address_taken flag
- detect redeclaration of parameters and issue an error
- set last_declaration in the parameter scope
- mark the scope of parameters

[r22060]

15 years agoAdd { as anchor while parsing k&r declaration list.
Christoph Mallon [Wed, 17 Sep 2008 21:49:45 +0000 (21:49 +0000)]
Add { as anchor while parsing k&r declaration list.

[r22059]

15 years agoImplement -Waddress.
Christoph Mallon [Wed, 17 Sep 2008 21:40:23 +0000 (21:40 +0000)]
Implement -Waddress.

[r22057]

15 years agoRestore value of in_gcc_extension using old_gcc_extension.
Christoph Mallon [Wed, 17 Sep 2008 20:04:31 +0000 (20:04 +0000)]
Restore value of in_gcc_extension using old_gcc_extension.

[r22054]

15 years agoAdd { as anchor while parsing external declaration.
Christoph Mallon [Wed, 17 Sep 2008 19:58:13 +0000 (19:58 +0000)]
Add { as anchor while parsing external declaration.

[r22053]

15 years agofixed comments
Michael Beck [Wed, 17 Sep 2008 19:28:50 +0000 (19:28 +0000)]
fixed comments

[r22052]

15 years ago- BugFix: typeof operator must set the in_type_prop attribute
Michael Beck [Wed, 17 Sep 2008 19:21:22 +0000 (19:21 +0000)]
- BugFix: typeof operator must set the in_type_prop attribute
- __extension__ now sets/resets the in_gcc_extension attribute
- use new GNU_MODE macro instead of (c_mode & _GNUC) which checks for in_gcc_extension

[r22051]

15 years agoReduce anchor scope.
Christoph Mallon [Wed, 17 Sep 2008 17:14:29 +0000 (17:14 +0000)]
Reduce anchor scope.

[r22050]

15 years agoadd support for gcc nested functions
Michael Beck [Wed, 17 Sep 2008 15:09:24 +0000 (15:09 +0000)]
add support for gcc nested functions

[r22043]

15 years agoadd missing print_indent() (now correctly prints nsted functions)
Michael Beck [Wed, 17 Sep 2008 15:08:48 +0000 (15:08 +0000)]
add missing print_indent() (now correctly prints nsted functions)

[r22042]

15 years agoeat_statement() is dead, long live eat_until_anchor()!
Christoph Mallon [Wed, 17 Sep 2008 14:56:33 +0000 (14:56 +0000)]
eat_statement() is dead, long live eat_until_anchor()!

[r22041]

15 years agonested function example
Michael Beck [Wed, 17 Sep 2008 14:52:31 +0000 (14:52 +0000)]
nested function example

[r22040]

15 years agoSmall simplification.
Christoph Mallon [Wed, 17 Sep 2008 14:47:40 +0000 (14:47 +0000)]
Small simplification.

[r22039]

15 years agodo not record empty declarations by default
Michael Beck [Wed, 17 Sep 2008 12:51:33 +0000 (12:51 +0000)]
do not record empty declarations by default

[r22036]

15 years ago- type property expressions are NOT self-initializer
Michael Beck [Wed, 17 Sep 2008 12:40:52 +0000 (12:40 +0000)]
- type property expressions are NOT self-initializer

[r22035]

15 years agoAlways return a non-null pointer from parse_array_declarator() to avoid dereferencing...
Christoph Mallon [Wed, 17 Sep 2008 08:55:51 +0000 (08:55 +0000)]
Always return a non-null pointer from parse_array_declarator() to avoid dereferencing a null pointer later on.

[r22029]

15 years agoThe element type of an array shall not be an incomplete or function type.
Christoph Mallon [Wed, 17 Sep 2008 07:50:51 +0000 (07:50 +0000)]
The element type of an array shall not be an incomplete or function type.

[r22028]

15 years agoStill record the element type of arrays and the return type of functions, even if...
Christoph Mallon [Wed, 17 Sep 2008 07:29:23 +0000 (07:29 +0000)]
Still record the element type of arrays and the return type of functions, even if they are invalid.

[r22027]

15 years agoWarn about type qualifiers in the return type of function types.
Christoph Mallon [Tue, 16 Sep 2008 18:38:09 +0000 (18:38 +0000)]
Warn about type qualifiers in the return type of function types.

[r22020]

15 years agoDo not warn about the return type of main(), if it is the error type.
Christoph Mallon [Tue, 16 Sep 2008 18:11:08 +0000 (18:11 +0000)]
Do not warn about the return type of main(), if it is the error type.

[r22017]

15 years agoUse the real error type instead of ATOMIC_TYPE_INVALID, when parsing type specifiers...
Christoph Mallon [Tue, 16 Sep 2008 18:06:30 +0000 (18:06 +0000)]
Use the real error type instead of ATOMIC_TYPE_INVALID, when parsing type specifiers, to avoid strange errors/warnings later on.

[r22016]

15 years agoAvoid segfault when encountering a parse error while parsing __declspec in type speci...
Christoph Mallon [Tue, 16 Sep 2008 18:02:07 +0000 (18:02 +0000)]
Avoid segfault when encountering a parse error while parsing __declspec in type specifiers.

[r22015]

15 years agoDo not warn about excess initialisers, when trying to initialise an incomplete compou...
Christoph Mallon [Tue, 16 Sep 2008 17:54:43 +0000 (17:54 +0000)]
Do not warn about excess initialisers, when trying to initialise an incomplete compound variable.

[r22014]

15 years agoSlightly simplify printing binary operators.
Christoph Mallon [Tue, 16 Sep 2008 17:53:24 +0000 (17:53 +0000)]
Slightly simplify printing binary operators.

[r22013]

15 years agoUse fputc() instead of fputs() to print a single char.
Christoph Mallon [Tue, 16 Sep 2008 12:38:38 +0000 (12:38 +0000)]
Use fputc() instead of fputs() to print a single char.

[r22006]

15 years agoPrint no " " between the ")" and the "{" of a compound literal.
Christoph Mallon [Tue, 16 Sep 2008 12:37:10 +0000 (12:37 +0000)]
Print no " " between the ")" and the "{" of a compound literal.

[r22005]

15 years agoabort() instead of exit(1) in case of anchor token leaks.
Christoph Mallon [Tue, 16 Sep 2008 10:48:48 +0000 (10:48 +0000)]
abort() instead of exit(1) in case of anchor token leaks.

[r22001]

15 years agoWhen printing AST for asm statements first print outputs, then inputs.
Christoph Mallon [Tue, 16 Sep 2008 10:09:34 +0000 (10:09 +0000)]
When printing AST for asm statements first print outputs, then inputs.

[r21998]

15 years agoImprove parse_va_start():
Christoph Mallon [Tue, 16 Sep 2008 09:39:36 +0000 (09:39 +0000)]
Improve parse_va_start():
- reference expressions never have no declaration, at least there is an error declaration
- do not return an invalid expression, when the second argument is a reference, but not the last parameter
- if the second parameter is invalid, still expect the ).

[r21997]

15 years agoMake parsing of statements more robust in case of parser errors by avoiding endless...
Christoph Mallon [Tue, 16 Sep 2008 09:06:10 +0000 (09:06 +0000)]
Make parsing of statements more robust in case of parser errors by avoiding endless loops, because no token gets consumed.

[r21996]

15 years agoPlug anchor token leak in parse_statement_expression().
Christoph Mallon [Tue, 16 Sep 2008 07:50:06 +0000 (07:50 +0000)]
Plug anchor token leak in parse_statement_expression().

[r21995]

15 years agoPlug two more anchor token underflows.
Christoph Mallon [Tue, 16 Sep 2008 07:19:52 +0000 (07:19 +0000)]
Plug two more anchor token underflows.

[r21994]

15 years agoFix the first anchor token leak (actually an underflow).
Christoph Mallon [Tue, 16 Sep 2008 07:16:38 +0000 (07:16 +0000)]
Fix the first anchor token leak (actually an underflow).

[r21993]

15 years agoAdd code to detect anchor token leaks.
Christoph Mallon [Tue, 16 Sep 2008 07:15:53 +0000 (07:15 +0000)]
Add code to detect anchor token leaks.

[r21992]

15 years agoCreate a few less invalid expressions on parse errors.
Christoph Mallon [Tue, 16 Sep 2008 06:38:51 +0000 (06:38 +0000)]
Create a few less invalid expressions on parse errors.

[r21991]

15 years agoIndentation.
Christoph Mallon [Tue, 16 Sep 2008 05:56:19 +0000 (05:56 +0000)]
Indentation.

[r21990]

15 years agoPrint \n after $invalid statement$.
Christoph Mallon [Tue, 16 Sep 2008 05:54:45 +0000 (05:54 +0000)]
Print \n after $invalid statement$.

[r21989]

15 years agoreverted 21986-21986, spec failed
Michael Beck [Tue, 16 Sep 2008 02:51:35 +0000 (02:51 +0000)]
reverted 21986-21986, spec failed

[r21988]

15 years ago- more simplification and unification of compound/enum types
Michael Beck [Tue, 16 Sep 2008 02:26:09 +0000 (02:26 +0000)]
- more simplification and unification of compound/enum types

[r21987]

15 years ago- when parsing compound types, do NOT destroy old declarations if
Michael Beck [Tue, 16 Sep 2008 02:09:35 +0000 (02:09 +0000)]
- when parsing compound types, do NOT destroy old declarations if
  a new one with the same name is found, always create a new one
- handle enums analog
- do not record "anonymous declarations" in the AST

[r21986]

15 years ago- do not print {} for incomplete types
Michael Beck [Tue, 16 Sep 2008 02:07:18 +0000 (02:07 +0000)]
- do not print {} for incomplete types

[r21985]

15 years ago- renamed is_empty to is_empty_range
Michael Beck [Tue, 16 Sep 2008 00:11:23 +0000 (00:11 +0000)]
- renamed is_empty to is_empty_range
- typo fixed

[r21984]

15 years agoFunction types only are compatible if their calling convention is the same, no matter...
Christoph Mallon [Mon, 15 Sep 2008 19:25:01 +0000 (19:25 +0000)]
Function types only are compatible if their calling convention is the same, no matter whether they have unspecified parameter lists.

[r21983]

15 years agoRemove redundant test from is_type_real() (is_type_float() checks this, too).
Christoph Mallon [Mon, 15 Sep 2008 19:21:21 +0000 (19:21 +0000)]
Remove redundant test from is_type_real() (is_type_float() checks this, too).

[r21982]

15 years agosome wrong bitfields
Michael Beck [Mon, 15 Sep 2008 15:23:12 +0000 (15:23 +0000)]
some wrong bitfields

[r21981]

15 years ago- implemented semantic checks for bitfield
Michael Beck [Mon, 15 Sep 2008 15:21:51 +0000 (15:21 +0000)]
- implemented semantic checks for bitfield

[r21980]

15 years agomore work on type size
Michael Beck [Mon, 15 Sep 2008 14:57:42 +0000 (14:57 +0000)]
more work on type size

[r21978]

15 years agoDo not initialise the variables declared in a for statement, if the initialisation...
Christoph Mallon [Mon, 15 Sep 2008 14:35:35 +0000 (14:35 +0000)]
Do not initialise the variables declared in a for statement, if the initialisation is not reachable.

[r21976]

15 years agoIn strict mode do not generate an implicit function declaration, but an error declara...
Christoph Mallon [Mon, 15 Sep 2008 14:12:00 +0000 (14:12 +0000)]
In strict mode do not generate an implicit function declaration, but an error declaration.  This prevents stray warnings about incompatible return types later on.

[r21973]

15 years agoAssert that no typerefs are passed to get_unqualified_type().
Christoph Mallon [Mon, 15 Sep 2008 13:12:28 +0000 (13:12 +0000)]
Assert that no typerefs are passed to get_unqualified_type().

[r21968]

15 years agoGet unqualified types before doing anything in semantic_arithmetic().
Christoph Mallon [Mon, 15 Sep 2008 12:50:12 +0000 (12:50 +0000)]
Get unqualified types before doing anything in semantic_arithmetic().

[r21967]

15 years agoBuild AST for [] even if none of the operands has pointer type. This prevents a...
Christoph Mallon [Mon, 15 Sep 2008 09:26:22 +0000 (09:26 +0000)]
Build AST for [] even if none of the operands has pointer type.  This prevents a segfault in the AST printer.  Also always set a return type, even if the ] is missing.

[r21962]

15 years agoParse the unlikely case, that someone writes "variable * ..." at the beginning of...
Christoph Mallon [Mon, 15 Sep 2008 09:15:06 +0000 (09:15 +0000)]
Parse the unlikely case, that someone writes "variable * ..." at the beginning of a expression statement, correctly.

[r21961]

15 years agoSpell the option -Wpointer-arith, not -Wpointer_arith.
Christoph Mallon [Mon, 15 Sep 2008 08:47:29 +0000 (08:47 +0000)]
Spell the option -Wpointer-arith, not -Wpointer_arith.

[r21957]

15 years agoFix warn_div_by_zero(): The result of the division might be int and the divisor non...
Christoph Mallon [Mon, 15 Sep 2008 07:56:36 +0000 (07:56 +0000)]
Fix warn_div_by_zero(): The result of the division might be int and the divisor non-int for /=.

[r21956]

15 years agoSpell the option -Wdiv-by-zero, not -Wdiv_by_zero.
Christoph Mallon [Mon, 15 Sep 2008 07:36:41 +0000 (07:36 +0000)]
Spell the option -Wdiv-by-zero, not -Wdiv_by_zero.

[r21955]

15 years agoFor an array access being an object with constant address, the array reference may...
Christoph Mallon [Mon, 15 Sep 2008 07:29:36 +0000 (07:29 +0000)]
For an array access being an object with constant address, the array reference may be object with constant address.

[r21954]

15 years agoDeMorganise.
Christoph Mallon [Mon, 15 Sep 2008 07:21:37 +0000 (07:21 +0000)]
DeMorganise.

[r21953]

15 years agoHandle the case when array access results in an address constant.
Christoph Mallon [Sun, 14 Sep 2008 21:49:41 +0000 (21:49 +0000)]
Handle the case when array access results in an address constant.

[r21952]

15 years agoCorrect and simplify the logic for -Wconversion.
Christoph Mallon [Sun, 14 Sep 2008 21:18:15 +0000 (21:18 +0000)]
Correct and simplify the logic for -Wconversion.

[r21951]

15 years agoFix warning message.
Christoph Mallon [Sun, 14 Sep 2008 18:29:21 +0000 (18:29 +0000)]
Fix warning message.

[r21950]

15 years agoPrevent errors about non-constant case labels in some common cases of prior errors...
Christoph Mallon [Sun, 14 Sep 2008 18:21:03 +0000 (18:21 +0000)]
Prevent errors about non-constant case labels in some common cases of prior errors while parsing the expression.

[r21949]

15 years agoPrevent stray error messages by pretending invalid references are address constants.
Christoph Mallon [Sun, 14 Sep 2008 17:50:19 +0000 (17:50 +0000)]
Prevent stray error messages by pretending invalid references are address constants.

[r21948]

15 years agoHandle the error type in descend_into_subtype().
Christoph Mallon [Sun, 14 Sep 2008 17:48:29 +0000 (17:48 +0000)]
Handle the error type in descend_into_subtype().

[r21947]

15 years agoHandle the error type in get_qualified_type().
Christoph Mallon [Sun, 14 Sep 2008 17:47:08 +0000 (17:47 +0000)]
Handle the error type in get_qualified_type().

[r21946]

15 years agoFix off-by-one error in source position in diagnostic messages in parse_reference().
Christoph Mallon [Sun, 14 Sep 2008 17:10:02 +0000 (17:10 +0000)]
Fix off-by-one error in source position in diagnostic messages in parse_reference().

[r21945]

15 years agoPretend the error type is compatible with every type, to suppress stray errors. ...
Christoph Mallon [Sun, 14 Sep 2008 16:58:33 +0000 (16:58 +0000)]
Pretend the error type is compatible with every type, to suppress stray errors.  Also prevent some warnings later on when a error declaration was generated and a proper declaration follows.

[r21944]

15 years agoCreate AST for select expressions even if the LHS has incomplete type.
Christoph Mallon [Sun, 14 Sep 2008 15:45:52 +0000 (15:45 +0000)]
Create AST for select expressions even if the LHS has incomplete type.

[r21943]

15 years ago- Ugly fix: MSVC runtime does not support long double printing, cast to double yet
Michael Beck [Sun, 14 Sep 2008 15:30:43 +0000 (15:30 +0000)]
- Ugly fix: MSVC runtime does not support long double printing, cast to double yet

[r21942]

15 years agoHandle typerefs in get_qualified_type().
Christoph Mallon [Sun, 14 Sep 2008 15:16:20 +0000 (15:16 +0000)]
Handle typerefs in get_qualified_type().

[r21941]

15 years agoFix parsing of function declarations with redundant parentheses around the declarator...
Christoph Mallon [Sun, 14 Sep 2008 15:12:27 +0000 (15:12 +0000)]
Fix parsing of function declarations with redundant parentheses around the declarator name.

[r21940]