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

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

12 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().

12 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.

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

12 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.

12 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()).

12 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.

12 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.

12 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".

12 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.

12 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.

12 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.

12 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().

12 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.

12 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().

12 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.

12 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().

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

12 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

12 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

12 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.

13 years agoReport an error when the index of an array access is not of integer type.
Christoph Mallon [Thu, 2 Jun 2011 07:20:10 +0000 (09:20 +0200)]
Report an error when the index of an array access is not of integer type.

13 years agoCleanup, reduce code duplication.
Christoph Mallon [Thu, 2 Jun 2011 07:13:36 +0000 (09:13 +0200)]
Cleanup, reduce code duplication.

13 years agoAdd missing check for reference declarator.
Christoph Mallon [Wed, 1 Jun 2011 08:46:06 +0000 (10:46 +0200)]
Add missing check for reference declarator.

13 years agoRemove unnecessary gotos.
Christoph Mallon [Wed, 1 Jun 2011 08:37:29 +0000 (10:37 +0200)]
Remove unnecessary gotos.

13 years agoMake error message a bit more clear.
Christoph Mallon [Wed, 1 Jun 2011 08:36:14 +0000 (10:36 +0200)]
Make error message a bit more clear.

13 years agoCleanup.
Christoph Mallon [Wed, 1 Jun 2011 08:34:59 +0000 (10:34 +0200)]
Cleanup.

Use (void) for empty parameter lists and reduce code duplication.

13 years agoUse a null pointer for marking the current position as unreachable again.
Christoph Mallon [Wed, 1 Jun 2011 08:34:15 +0000 (10:34 +0200)]
Use a null pointer for marking the current position as unreachable again.

Using a BadBB has no benefits.

13 years agoAdd Bad preds for unreachable code
Andreas Zwinkau [Tue, 31 May 2011 14:10:30 +0000 (16:10 +0200)]
Add Bad preds for unreachable code

Fixes C/segfault7

13 years agoConstruct Bads for unreachable code
Andreas Zwinkau [Tue, 31 May 2011 14:02:01 +0000 (16:02 +0200)]
Construct Bads for unreachable code

Otherwise local opts might produce "strange" graphs, for example, loops without Phis.

13 years agoIgnore -fvisibility= arguments
Andreas Zwinkau [Tue, 31 May 2011 12:16:39 +0000 (14:16 +0200)]
Ignore -fvisibility= arguments

13 years agoReport an error on empty character constants, i.e. ''.
Christoph Mallon [Tue, 31 May 2011 11:41:18 +0000 (13:41 +0200)]
Report an error on empty character constants, i.e. ''.

13 years agotrigger flip-flopping normalisation
Matthias Braun [Tue, 31 May 2011 10:47:11 +0000 (12:47 +0200)]
trigger flip-flopping normalisation

13 years agoadded --help texts which document most options
Matthias Braun [Mon, 30 May 2011 12:22:34 +0000 (14:22 +0200)]
added --help texts which document most options

13 years agoremove unsupported option omit-leaf-frame-pointer option
Matthias Braun [Fri, 27 May 2011 09:08:20 +0000 (11:08 +0200)]
remove unsupported option omit-leaf-frame-pointer option

13 years agooption was parsed twice
Matthias Braun [Fri, 27 May 2011 09:03:09 +0000 (11:03 +0200)]
option was parsed twice

13 years agoCorrect parsing of abstract function declarators.
Christoph Mallon [Mon, 30 May 2011 10:33:28 +0000 (12:33 +0200)]
Correct parsing of abstract function declarators.

13 years agoPrevent dereferencing a null pointer, when parse_attribute_gnu() returns an empty...
Christoph Mallon [Sun, 29 May 2011 10:16:20 +0000 (12:16 +0200)]
Prevent dereferencing a null pointer, when parse_attribute_gnu() returns an empty list of attributes.

13 years agofix a few builtin declarations, add stpcpy builtin
Matthias Braun [Sat, 7 May 2011 11:05:39 +0000 (13:05 +0200)]
fix a few builtin declarations, add stpcpy builtin

13 years agofix const_void_ptr builtin types
Matthias Braun [Sat, 7 May 2011 00:09:42 +0000 (02:09 +0200)]
fix const_void_ptr builtin types

13 years agoremoving unused entities from the frame should happen as late as possible
Matthias Braun [Thu, 26 May 2011 11:28:26 +0000 (13:28 +0200)]
removing unused entities from the frame should happen as late as possible

13 years agoperform a convopt after target lowering, reorder some localopts
Matthias Braun [Thu, 26 May 2011 11:09:30 +0000 (13:09 +0200)]
perform a convopt after target lowering, reorder some localopts

13 years agoignore type qualifiers when checking arguments of main
Matthias Braun [Tue, 24 May 2011 10:23:55 +0000 (12:23 +0200)]
ignore type qualifiers when checking arguments of main

13 years agoremove pointless concept of a builtin-type
Matthias Braun [Tue, 24 May 2011 09:32:10 +0000 (11:32 +0200)]
remove pointless concept of a builtin-type

13 years agoFixed parameter type.
Sebastian Buchwald [Thu, 19 May 2011 15:01:38 +0000 (17:01 +0200)]
Fixed parameter type.

13 years agoAvoid unnecessary casts.
Christoph Mallon [Thu, 19 May 2011 11:29:46 +0000 (13:29 +0200)]
Avoid unnecessary casts.

13 years agoRemove the unnecessary distinction between compound_t structe and compound_t unione...
Christoph Mallon [Thu, 19 May 2011 06:33:00 +0000 (08:33 +0200)]
Remove the unnecessary distinction between compound_t structe and compound_t unione in struct entity_t, just use compound_t compound.

Its only use was causing code duplication in the AST printer anyway.
Everybody else already uses compound.

13 years agoWhitespace fix.
Christoph Mallon [Thu, 19 May 2011 05:38:56 +0000 (07:38 +0200)]
Whitespace fix.

13 years agoRemove unnecessary cast.
Christoph Mallon [Thu, 19 May 2011 05:38:43 +0000 (07:38 +0200)]
Remove unnecessary cast.

13 years agoHandle GNU __REDIRECT on MACHO.
Christoph Mallon [Thu, 19 May 2011 05:36:39 +0000 (07:36 +0200)]
Handle GNU __REDIRECT on MACHO.

13 years agoCorrent whitespace inconsistencies when printing type qualifiers.
Christoph Mallon [Mon, 16 May 2011 14:11:20 +0000 (16:11 +0200)]
Corrent whitespace inconsistencies when printing type qualifiers.

13 years agoRevert "gcse requires unreachable code removed"
Matthias Braun [Wed, 11 May 2011 10:36:42 +0000 (12:36 +0200)]
Revert "gcse requires unreachable code removed"

This reverts commit 246fd89748d4ad7ba600f4369f73f2ea9c60c76f.

13 years agogcse requires unreachable code removed
Andreas Zwinkau [Fri, 6 May 2011 10:48:57 +0000 (12:48 +0200)]
gcse requires unreachable code removed

13 years agoadapt to firm allowing Bad with different modes now
Matthias Braun [Thu, 5 May 2011 17:12:35 +0000 (19:12 +0200)]
adapt to firm allowing Bad with different modes now

13 years agoDo not compare boolean values with false/true, just use them.
Christoph Mallon [Thu, 5 May 2011 15:29:41 +0000 (17:29 +0200)]
Do not compare boolean values with false/true, just use them.