cparser
12 years agoOoops, streq is the right function here.
Sebastian Buchwald [Fri, 8 Jul 2011 11:41:56 +0000 (13:41 +0200)]
Ooops, streq is the right function here.

12 years agoOops, fixed compile error.
Sebastian Buchwald [Fri, 8 Jul 2011 11:29:05 +0000 (13:29 +0200)]
Oops, fixed compile error.

12 years agoUse an example from the list above.
Sebastian Buchwald [Fri, 8 Jul 2011 08:10:19 +0000 (10:10 +0200)]
Use an example from the list above.

12 years agoDo not parse meaningless fno-... options.
Sebastian Buchwald [Fri, 8 Jul 2011 07:42:15 +0000 (09:42 +0200)]
Do not parse meaningless fno-... options.

This affects:
- showing the help text
- enabling floating points models

12 years agoAdded missing help entry.
Sebastian Buchwald [Fri, 8 Jul 2011 07:41:14 +0000 (09:41 +0200)]
Added missing help entry.

12 years agoConsistently use upper case in help text.
Sebastian Buchwald [Fri, 8 Jul 2011 07:08:28 +0000 (09:08 +0200)]
Consistently use upper case in help text.

12 years agoReplaced n't by not.
Sebastian Buchwald [Fri, 8 Jul 2011 07:06:35 +0000 (09:06 +0200)]
Replaced n't by not.

12 years agoImproved help message.
Sebastian Buchwald [Thu, 7 Jul 2011 11:16:52 +0000 (13:16 +0200)]
Improved help message.

12 years agoOne help entry for -ffp-precise is sufficient.
Sebastian Buchwald [Thu, 7 Jul 2011 11:16:00 +0000 (13:16 +0200)]
One help entry for -ffp-precise is sufficient.

12 years agoFixed error message.
Sebastian Buchwald [Thu, 7 Jul 2011 10:43:43 +0000 (12:43 +0200)]
Fixed error message.

12 years agoProperly handle %{h,hh}{d,u} in the printf format checker.
Christoph Mallon [Thu, 7 Jul 2011 12:13:16 +0000 (14:13 +0200)]
Properly handle %{h,hh}{d,u} in the printf format checker.

12 years agoWarn that the '0' flag is ignored, if the precision is present in a format specification.
Christoph Mallon [Thu, 7 Jul 2011 12:12:18 +0000 (14:12 +0200)]
Warn that the '0' flag is ignored, if the precision is present in a format specification.

12 years agoParse __extension__ like GCC: It must not appear in declaration specifiers.
Christoph Mallon [Tue, 5 Jul 2011 09:36:28 +0000 (11:36 +0200)]
Parse __extension__ like GCC: It must not appear in declaration specifiers.

12 years agoParse __extension__ like GCC: It must not appear at the start of parameter declarations.
Christoph Mallon [Tue, 5 Jul 2011 09:37:47 +0000 (11:37 +0200)]
Parse __extension__ like GCC: It must not appear at the start of parameter declarations.

12 years agoParse __extension__ like GCC: It must not appear in typeof().
Christoph Mallon [Tue, 5 Jul 2011 09:35:37 +0000 (11:35 +0200)]
Parse __extension__ like GCC: It must not appear in typeof().

12 years agoParse __extension__ like GCC: Compound entry declarations may start with it.
Christoph Mallon [Tue, 5 Jul 2011 09:52:14 +0000 (11:52 +0200)]
Parse __extension__ like GCC: Compound entry declarations may start with it.

12 years agoParse __extension__ like GCC: External declarations may start with it.
Christoph Mallon [Tue, 5 Jul 2011 09:51:24 +0000 (11:51 +0200)]
Parse __extension__ like GCC: External declarations may start with it.

12 years agoAdd PUSH_EXTENSION()/POP_EXTENSION() to reduce code duplication.
Christoph Mallon [Tue, 5 Jul 2011 09:41:22 +0000 (11:41 +0200)]
Add PUSH_EXTENSION()/POP_EXTENSION() to reduce code duplication.

13 years agoC99: Declarations are not allowed as inner statements (they are no statements in...
Christoph Mallon [Thu, 30 Jun 2011 04:39:16 +0000 (06:39 +0200)]
C99: Declarations are not allowed as inner statements (they are no statements in C99).

13 years agoWrap switching scopes in the macros PUSH_SCOPE() and POP_SCOPE().
Christoph Mallon [Wed, 29 Jun 2011 07:28:51 +0000 (09:28 +0200)]
Wrap switching scopes in the macros PUSH_SCOPE() and POP_SCOPE().

13 years agoAssert in POP_PARENT() that the statement pushed in the corresponding PUSH_PARENT...
Christoph Mallon [Wed, 29 Jun 2011 07:20:22 +0000 (09:20 +0200)]
Assert in POP_PARENT() that the statement pushed in the corresponding PUSH_PARENT() is still on top.

13 years agoConsistently use PUSH_PARENT()/POP_PARENT().
Christoph Mallon [Wed, 29 Jun 2011 07:18:27 +0000 (09:18 +0200)]
Consistently use PUSH_PARENT()/POP_PARENT().

This corrects having the wrong parent after parsing an inner function.

13 years agoTurn POP_PARENT into a function-like macro for visual consistency.
Christoph Mallon [Wed, 29 Jun 2011 06:46:00 +0000 (08:46 +0200)]
Turn POP_PARENT into a function-like macro for visual consistency.

13 years agoImprove error handling: Do not jump to the error_label if expect() finally finds...
Christoph Mallon [Mon, 27 Jun 2011 14:08:05 +0000 (16:08 +0200)]
Improve error handling: Do not jump to the error_label if expect() finally finds the expected token after dropping some others.

13 years agoRecord correct source position for compound literals.
Christoph Mallon [Mon, 27 Jun 2011 13:04:58 +0000 (15:04 +0200)]
Record correct source position for compound literals.

13 years agoDo not redundantly set the source position again after allocate_expression_zero(...
Christoph Mallon [Mon, 27 Jun 2011 12:46:38 +0000 (14:46 +0200)]
Do not redundantly set the source position again after allocate_expression_zero() did it.

13 years agoSimplify is_octal_digit().
Christoph Mallon [Mon, 27 Jun 2011 09:18:13 +0000 (11:18 +0200)]
Simplify is_octal_digit().

13 years agoPrevent endless loop parse_compound_type_entries().
Christoph Mallon [Mon, 27 Jun 2011 09:10:06 +0000 (11:10 +0200)]
Prevent endless loop parse_compound_type_entries().

13 years agoCorrect off-by-one-token error when allocating attributes.
Christoph Mallon [Mon, 27 Jun 2011 05:17:32 +0000 (07:17 +0200)]
Correct off-by-one-token error when allocating attributes.

13 years agoRecord the position of attributes.
Christoph Mallon [Mon, 27 Jun 2011 05:15:58 +0000 (07:15 +0200)]
Record the position of attributes.

The mechanism is there, some warning messages show the position, but recording it was missing in allocate_attribute_zero().

13 years agoCorrect token encoding: wide string literals L"" and -> shared the same enum value
Christoph Mallon [Mon, 27 Jun 2011 04:57:37 +0000 (06:57 +0200)]
Correct token encoding: wide string literals L"" and -> shared the same enum value

- This resulted in wrong error messages when an unexpected -> was found in the input.
- Remove the magic 265 (used explicitly by ->) by reordering the tokens.

13 years agoAdd missing TYPE_REFERENCE to get_type_struct_size().
Christoph Mallon [Mon, 27 Jun 2011 04:52:34 +0000 (06:52 +0200)]
Add missing TYPE_REFERENCE to get_type_struct_size().

13 years agoCorrect off-by-one-token error in parse_return().
Christoph Mallon [Mon, 27 Jun 2011 04:50:56 +0000 (06:50 +0200)]
Correct off-by-one-token error in parse_return().

13 years agoRemove ancient assignments to source_position in parse_subexpression().
Christoph Mallon [Sat, 25 Jun 2011 08:47:03 +0000 (10:47 +0200)]
Remove ancient assignments to source_position in parse_subexpression().

These are obsolete (and wrong) since allocate_expression_zero() sets the source_position.

13 years agoMerge branch 'makefilefix'
Andreas Zwinkau [Fri, 24 Jun 2011 14:00:58 +0000 (16:00 +0200)]
Merge branch 'makefilefix'

13 years agoRemove firm_cmdline from Makefile
Andreas Zwinkau [Fri, 24 Jun 2011 14:00:08 +0000 (16:00 +0200)]
Remove firm_cmdline from Makefile

13 years agoSimplify daisy-chaining parameters in make_function_type().
Christoph Mallon [Fri, 24 Jun 2011 06:15:52 +0000 (08:15 +0200)]
Simplify daisy-chaining parameters in make_function_type().

13 years agoMake type_obst static and remove unnecessary pointer indirection.
Christoph Mallon [Fri, 24 Jun 2011 05:55:33 +0000 (07:55 +0200)]
Make type_obst static and remove unnecessary pointer indirection.

13 years agoRemove duplicate allocate_parameter().
Christoph Mallon [Fri, 24 Jun 2011 05:53:58 +0000 (07:53 +0200)]
Remove duplicate allocate_parameter().

13 years agoUse allocate_type_zero() to reduce code duplication.
Christoph Mallon [Fri, 24 Jun 2011 05:46:51 +0000 (07:46 +0200)]
Use allocate_type_zero() to reduce code duplication.

13 years agoInline allocate_ast() into its only caller (allocate_ast_zero()).
Christoph Mallon [Thu, 23 Jun 2011 08:46:11 +0000 (10:46 +0200)]
Inline allocate_ast() into its only caller (allocate_ast_zero()).

13 years agoSimplify some do-while-0 macros.
Christoph Mallon [Wed, 22 Jun 2011 06:34:10 +0000 (08:34 +0200)]
Simplify some do-while-0 macros.

13 years agoImplement -f[no-]diagnostics-show-option.
Christoph Mallon [Wed, 22 Jun 2011 05:44:19 +0000 (07:44 +0200)]
Implement -f[no-]diagnostics-show-option.

13 years ago"For example" is "e.g." (exempli gratia), not "i.e." (id est), which means "that...
Christoph Mallon [Wed, 22 Jun 2011 05:29:15 +0000 (07:29 +0200)]
"For example" is "e.g." (exempli gratia), not "i.e." (id est), which means "that is".

13 years agoMake warning switch parsing compatible to GCC: -W[no-][error=]warning.
Christoph Mallon [Tue, 21 Jun 2011 20:22:54 +0000 (22:22 +0200)]
Make warning switch parsing compatible to GCC: -W[no-][error=]warning.

13 years agoFix regression: A format argument went missing.
Christoph Mallon [Tue, 21 Jun 2011 16:07:43 +0000 (18:07 +0200)]
Fix regression: A format argument went missing.

13 years agoImprove diagnostic handling: Add [-Wfoo] and -Werror-foo.
Christoph Mallon [Tue, 21 Jun 2011 13:43:56 +0000 (15:43 +0200)]
Improve diagnostic handling: Add [-Wfoo] and -Werror-foo.

- Print the name of the warning switch at the end of each warning message, e.g. [-Wfoo]
- Every warning can now be turned into an error with -Werror-foo.

13 years agoDo not generate warnings for implicit declarations in record_entity().
Christoph Mallon [Tue, 21 Jun 2011 12:35:50 +0000 (14:35 +0200)]
Do not generate warnings for implicit declarations in record_entity().

13 years agoReduce code duplication.
Christoph Mallon [Tue, 21 Jun 2011 12:20:27 +0000 (14:20 +0200)]
Reduce code duplication.

The duplicate contained a bug, of course: The shown position was wrong.

13 years agoAdd %N and %#N for printing entities to diagnosticf().
Christoph Mallon [Tue, 21 Jun 2011 09:20:25 +0000 (11:20 +0200)]
Add %N and %#N for printing entities to diagnosticf().

13 years agoSort format specifiers in comment for diagnosticf() and add missing variants.
Christoph Mallon [Tue, 21 Jun 2011 09:13:29 +0000 (11:13 +0200)]
Sort format specifiers in comment for diagnosticf() and add missing variants.

13 years agoReduce code duplication in semantic_comparison().
Christoph Mallon [Tue, 21 Jun 2011 09:03:02 +0000 (11:03 +0200)]
Reduce code duplication in semantic_comparison().

13 years agoRemove unnecessary goto.
Christoph Mallon [Fri, 17 Jun 2011 11:12:33 +0000 (13:12 +0200)]
Remove unnecessary goto.

13 years agorename is_address_constant to is_linker_constant, document functions
Matthias Braun [Tue, 21 Jun 2011 12:04:50 +0000 (14:04 +0200)]
rename is_address_constant to is_linker_constant, document functions

13 years agofix is_address_constant EXPR_SELECT case
Matthias Braun [Tue, 21 Jun 2011 12:03:15 +0000 (14:03 +0200)]
fix is_address_constant  EXPR_SELECT case

13 years agoadd missing EXPR_SELECT case in is_address_constant
Matthias Braun [Mon, 20 Jun 2011 17:24:02 +0000 (19:24 +0200)]
add missing EXPR_SELECT case in is_address_constant

13 years agofix cparser warnings
Matthias Braun [Fri, 17 Jun 2011 19:15:53 +0000 (21:15 +0200)]
fix cparser warnings

13 years agofix a bunch of warnings (reported by cparser)
Matthias Braun [Wed, 15 Jun 2011 17:03:21 +0000 (19:03 +0200)]
fix a bunch of warnings (reported by cparser)

13 years agoadd -Wmissing-declarations to -Wall
Matthias Braun [Wed, 15 Jun 2011 13:33:50 +0000 (15:33 +0200)]
add -Wmissing-declarations to -Wall

13 years agoquery firm backend for machine_size and long double size
Matthias Braun [Wed, 15 Jun 2011 13:00:28 +0000 (15:00 +0200)]
query firm backend for machine_size and long double size

13 years agoremove strange warning
Matthias Braun [Wed, 15 Jun 2011 12:57:04 +0000 (14:57 +0200)]
remove strange warning

A warning which notifies me that I use a GNU extension is strange.
If I don't want to use them I can do -std=c99 and turn the situation
into an error. When I do use them I don't(!) want to see a warning.

13 years agofix some cparser warnings
Matthias Braun [Wed, 15 Jun 2011 12:56:20 +0000 (14:56 +0200)]
fix some cparser warnings

13 years agoMake error correction more robust when the parser encounters a storage class where...
Christoph Mallon [Fri, 17 Jun 2011 07:15:17 +0000 (09:15 +0200)]
Make error correction more robust when the parser encounters a storage class where it only expected a typename.

13 years agoImprove error message for invalid types in array access.
Christoph Mallon [Fri, 17 Jun 2011 04:54:28 +0000 (06:54 +0200)]
Improve error message for invalid types in array access.

13 years agoCorrect wrong positions in error/warning messages.
Christoph Mallon [Thu, 16 Jun 2011 16:43:46 +0000 (18:43 +0200)]
Correct wrong positions in error/warning messages.

13 years agos/threat/treat/.
Christoph Mallon [Fri, 17 Jun 2011 04:09:28 +0000 (06:09 +0200)]
s/threat/treat/.

13 years agoRemove unnecessary goto.
Christoph Mallon [Fri, 17 Jun 2011 04:04:38 +0000 (06:04 +0200)]
Remove unnecessary goto.

13 years agoMark a label as used when it is actually used, not later on in the label checker.
Christoph Mallon [Fri, 17 Jun 2011 03:45:07 +0000 (05:45 +0200)]
Mark a label as used when it is actually used, not later on in the label checker.

13 years agoLet get_label() handle consuming the label identifier instead of all its callers.
Christoph Mallon [Thu, 16 Jun 2011 21:00:26 +0000 (23:00 +0200)]
Let get_label() handle consuming the label identifier instead of all its callers.

13 years agoClean up get_label().
Christoph Mallon [Thu, 16 Jun 2011 20:15:01 +0000 (22:15 +0200)]
Clean up get_label().

13 years agoPass the symbol to allocate_entity_zero() instead of setting it later on.
Christoph Mallon [Thu, 16 Jun 2011 17:27:47 +0000 (19:27 +0200)]
Pass the symbol to allocate_entity_zero() instead of setting it later on.

13 years agoPass the namespace to allocate_entity_zero() instead of setting it later on.
Christoph Mallon [Thu, 16 Jun 2011 17:07:58 +0000 (19:07 +0200)]
Pass the namespace to allocate_entity_zero() instead of setting it later on.

13 years agoDo not bail out on simple typo of put/get in parse_attribute_ms_property().
Christoph Mallon [Thu, 16 Jun 2011 14:22:21 +0000 (16:22 +0200)]
Do not bail out on simple typo of put/get in parse_attribute_ms_property().

13 years agoRemove unnecessary error message.
Christoph Mallon [Thu, 16 Jun 2011 14:46:16 +0000 (16:46 +0200)]
Remove unnecessary error message.

If this case is entered, there was an error message that the declarator is abstract before.

13 years agoSimplify format string in error message.
Christoph Mallon [Thu, 16 Jun 2011 14:08:44 +0000 (16:08 +0200)]
Simplify format string in error message.

13 years agoRemove if (type != NULL), which due to prior program logic cannot be false.
Christoph Mallon [Thu, 16 Jun 2011 13:47:33 +0000 (15:47 +0200)]
Remove if (type != NULL), which due to prior program logic cannot be false.

13 years agoCorrect off-by-one error when checking whether the end of the GNU attribute list...
Christoph Mallon [Thu, 16 Jun 2011 13:29:40 +0000 (15:29 +0200)]
Correct off-by-one error when checking whether the end of the GNU attribute list was reached.

13 years agoDo not unnecessarily bail out early when encountering certain parse errors.
Christoph Mallon [Thu, 16 Jun 2011 12:32:17 +0000 (14:32 +0200)]
Do not unnecessarily bail out early when encountering certain parse errors.

13 years agoCorrect off-by-one-token error in warning.
Christoph Mallon [Thu, 16 Jun 2011 09:31:29 +0000 (11:31 +0200)]
Correct off-by-one-token error in warning.

13 years agoHandle the initial memset() of the declaration specifier struct in parse_declaration_...
Christoph Mallon [Thu, 16 Jun 2011 05:22:20 +0000 (07:22 +0200)]
Handle the initial memset() of the declaration specifier struct in parse_declaration_specifiers().

13 years agoImplement and document -Wshadow-local.
Christoph Mallon [Wed, 15 Jun 2011 16:47:29 +0000 (18:47 +0200)]
Implement and document -Wshadow-local.

- This works like -Wshadow, but only warns if the shadowed declaration is not global.
- Activate it with -Wall.
- Demote -Wshadow to -Wextra.

13 years agoAccept -W as alias for -Wextra.
Christoph Mallon [Wed, 15 Jun 2011 16:46:37 +0000 (18:46 +0200)]
Accept -W as alias for -Wextra.

13 years agoAdd EXPR_LITERAL_BOOLEAN to get_expression_struct_size().
Christoph Mallon [Wed, 15 Jun 2011 06:01:36 +0000 (08:01 +0200)]
Add EXPR_LITERAL_BOOLEAN to get_expression_struct_size().

13 years agooptimisation => optimization
Matthias Braun [Fri, 10 Jun 2011 13:28:41 +0000 (15:28 +0200)]
optimisation => optimization

13 years agoamend to --help
Matthias Braun [Fri, 10 Jun 2011 13:29:09 +0000 (15:29 +0200)]
amend to --help

13 years agoreorganize firm_cmdline, implement --help-optimization
Matthias Braun [Fri, 10 Jun 2011 13:25:26 +0000 (15:25 +0200)]
reorganize firm_cmdline, implement --help-optimization

13 years agowe (and gcc) have no real -fstrength-reduce
Matthias Braun [Fri, 10 Jun 2011 12:56:45 +0000 (14:56 +0200)]
we (and gcc) have no real -fstrength-reduce

13 years agomove -ffp-XXX flags handling to main cparser to be more independent of firm_cmdline
Matthias Braun [Fri, 10 Jun 2011 12:51:48 +0000 (14:51 +0200)]
move -ffp-XXX flags handling to main cparser to be more independent of firm_cmdline

13 years agoadded elf-visibility handling
Matthias Braun [Thu, 9 Jun 2011 11:43:47 +0000 (13:43 +0200)]
added elf-visibility handling

Currently only used for jna export though.

13 years agofix crash when mode attribut misses arguments
Matthias Braun [Thu, 9 Jun 2011 11:17:39 +0000 (13:17 +0200)]
fix crash when mode attribut misses arguments

13 years agomove docu comments to header
Matthias Braun [Thu, 9 Jun 2011 11:06:07 +0000 (13:06 +0200)]
move docu comments to header

13 years agopreprocessor has to be aware of bitwidth too
Matthias Braun [Tue, 7 Jun 2011 11:07:04 +0000 (13:07 +0200)]
preprocessor has to be aware of bitwidth too

13 years agolong overflows at LONG_MAX not at INT_MAX
Matthias Braun [Tue, 7 Jun 2011 10:41:42 +0000 (12:41 +0200)]
long overflows at LONG_MAX not at INT_MAX

13 years agoUse internal_errorf() instead of errorf() for internal errors -- quite logical, isn...
Christoph Mallon [Mon, 6 Jun 2011 13:33:55 +0000 (15:33 +0200)]
Use internal_errorf() instead of errorf() for internal errors -- quite logical, isn't it?

13 years agoUse variables more consistently.
Christoph Mallon [Sat, 4 Jun 2011 12:44:22 +0000 (14:44 +0200)]
Use variables more consistently.

13 years agoReduce code duplication.
Christoph Mallon [Sat, 4 Jun 2011 12:43:29 +0000 (14:43 +0200)]
Reduce code duplication.

13 years agoCorrect off-by-something errors in diagnostic messages.
Christoph Mallon [Sat, 4 Jun 2011 12:33:24 +0000 (14:33 +0200)]
Correct off-by-something errors in diagnostic messages.

13 years agoFeature: Show the column number in diagnostic messages.
Christoph Mallon [Sat, 4 Jun 2011 12:27:05 +0000 (14:27 +0200)]
Feature: Show the column number in diagnostic messages.

- This can be toggled with -f[no-]show-column. Default is on.
- The column number can be off, because gcc's preprocessors collapses consecutive whitespace.

13 years agoRename the attribute linenr of struct source_position_t to lineno.
Christoph Mallon [Sat, 4 Jun 2011 12:35:35 +0000 (14:35 +0200)]
Rename the attribute linenr of struct source_position_t to lineno.

13 years agoReduce code duplication for printing diagnostics.
Christoph Mallon [Sat, 4 Jun 2011 11:56:55 +0000 (13:56 +0200)]
Reduce code duplication for printing diagnostics.