cparser
11 years agosimple support for __attribute__((alias("symbol"))) alias
Szabolcs Nagy [Thu, 27 Dec 2012 15:38:52 +0000 (16:38 +0100)]
simple support for __attribute__((alias("symbol")))

11 years agocleanup: Add and use macro MIN().
Christoph Mallon [Tue, 25 Dec 2012 19:13:27 +0000 (20:13 +0100)]
cleanup: Add and use macro MIN().

11 years agocleanup: Add and use macro MAX().
Christoph Mallon [Tue, 25 Dec 2012 19:13:14 +0000 (20:13 +0100)]
cleanup: Add and use macro MAX().

11 years agoast2firm: Correct IR creation for __alignof__.
Christoph Mallon [Wed, 26 Dec 2012 07:57:36 +0000 (08:57 +0100)]
ast2firm: Correct IR creation for __alignof__.

11 years agoparser: Remove the unused attribute alignment from struct declaration_specifiers_t.
Christoph Mallon [Wed, 26 Dec 2012 08:08:38 +0000 (09:08 +0100)]
parser: Remove the unused attribute alignment from struct declaration_specifiers_t.

11 years agoparser: Remove the unnecessary special case to parse anonymous bitfields.
Christoph Mallon [Wed, 26 Dec 2012 07:05:39 +0000 (08:05 +0100)]
parser: Remove the unnecessary special case to parse anonymous bitfields.

11 years agocleanup: Use round_up2() instead of duplicating it.
Christoph Mallon [Tue, 25 Dec 2012 18:26:57 +0000 (19:26 +0100)]
cleanup: Use round_up2() instead of duplicating it.

11 years agocleanup: Remove duplicate definitions of is_po2().
Christoph Mallon [Tue, 25 Dec 2012 18:18:46 +0000 (19:18 +0100)]
cleanup: Remove duplicate definitions of is_po2().

11 years agoast2firm: Let firm handle the layout of the frame type.
Christoph Mallon [Tue, 25 Dec 2012 17:41:15 +0000 (18:41 +0100)]
ast2firm: Let firm handle the layout of the frame type.

11 years agocleanup: Correct wrong usage of feof().
Christoph Mallon [Tue, 25 Dec 2012 15:48:12 +0000 (16:48 +0100)]
cleanup: Correct wrong usage of feof().

11 years agocleanup: Remove unnecessary #include.
Christoph Mallon [Tue, 25 Dec 2012 15:42:30 +0000 (16:42 +0100)]
cleanup: Remove unnecessary #include.

11 years agotype: Make an assert()ion independent of the last entry of an enum.
Christoph Mallon [Tue, 25 Dec 2012 12:08:07 +0000 (13:08 +0100)]
type: Make an assert()ion independent of the last entry of an enum.

11 years agoentity: Remove the unused attribute irtype from struct enum_t.
Christoph Mallon [Tue, 25 Dec 2012 01:35:40 +0000 (02:35 +0100)]
entity: Remove the unused attribute irtype from struct enum_t.

11 years agoast2firm: Make get_ir_type() static.
Christoph Mallon [Sun, 23 Dec 2012 11:28:52 +0000 (12:28 +0100)]
ast2firm: Make get_ir_type() static.

11 years agomangle: Use the cparser type, not the firm type, to mangle stdcall names.
Christoph Mallon [Sun, 23 Dec 2012 11:27:21 +0000 (12:27 +0100)]
mangle: Use the cparser type, not the firm type, to mangle stdcall names.

11 years agotype_hash: The error type is equal to itself.
Christoph Mallon [Sun, 23 Dec 2012 10:22:51 +0000 (11:22 +0100)]
type_hash: The error type is equal to itself.

11 years agocleanup: Remove stale math includes.
Christoph Mallon [Wed, 26 Dec 2012 14:43:13 +0000 (15:43 +0100)]
cleanup: Remove stale math includes.

11 years agoast2firm: Remove the unused function get_atomic_mode().
Christoph Mallon [Sat, 22 Dec 2012 12:19:38 +0000 (13:19 +0100)]
ast2firm: Remove the unused function get_atomic_mode().

11 years agoast2firm: Evaluate the operand of a void cast for its side effects again.
Christoph Mallon [Thu, 27 Dec 2012 08:28:45 +0000 (09:28 +0100)]
ast2firm: Evaluate the operand of a void cast for its side effects again.

11 years agoUse new scope instead of empty statement.
Sebastian Buchwald [Fri, 21 Dec 2012 17:19:40 +0000 (18:19 +0100)]
Use new scope instead of empty statement.

11 years agoFixed indentation.
Sebastian Buchwald [Fri, 14 Dec 2012 13:43:21 +0000 (14:43 +0100)]
Fixed indentation.

11 years agoUse SINGLE_OPTION macro.
Sebastian Buchwald [Fri, 14 Dec 2012 13:43:08 +0000 (14:43 +0100)]
Use SINGLE_OPTION macro.

11 years agoFixed typo.
Sebastian Buchwald [Fri, 14 Dec 2012 13:42:28 +0000 (14:42 +0100)]
Fixed typo.

11 years agosemantic: Extend expression classification to detect integer constant expressions.
Christoph Mallon [Thu, 20 Dec 2012 13:11:26 +0000 (14:11 +0100)]
semantic: Extend expression classification to detect integer constant expressions.

This is required for strict detection of null pointer constants and VLAs.

11 years agofix null pointer constants
Matthias Braun [Wed, 19 Dec 2012 16:55:19 +0000 (17:55 +0100)]
fix null pointer constants

only a cast to void* gives a null pointer constant, casting to types
compatible with void* not necessarily.

11 years agoenable -pedantic gcc flag
Matthias Braun [Mon, 17 Dec 2012 12:22:55 +0000 (13:22 +0100)]
enable -pedantic gcc flag

11 years agocleanup: Resolve warnings about shadowed variables.
Christoph Mallon [Mon, 17 Dec 2012 14:34:52 +0000 (15:34 +0100)]
cleanup: Resolve warnings about shadowed variables.

11 years agouse module_shift from base_mode when constructing bitfield modes
Matthias Braun [Mon, 17 Dec 2012 13:02:21 +0000 (14:02 +0100)]
use module_shift from base_mode when constructing bitfield modes

11 years agosemantic: Accept complex literal suffixes even in non-gcc mode.
Christoph Mallon [Mon, 17 Dec 2012 10:27:36 +0000 (11:27 +0100)]
semantic: Accept complex literal suffixes even in non-gcc mode.

FreeBSD's system headers use them without __extension__ and gcc accepts them with -std=c99, too.

11 years agosemantic: Combine check_integer_suffix() and check_floatingpoint_suffix() into check_...
Christoph Mallon [Mon, 17 Dec 2012 10:25:40 +0000 (11:25 +0100)]
semantic: Combine check_integer_suffix() and check_floatingpoint_suffix() into check_number_suffix().

This corrects two issues for floatingpoint suffixes:
- Accept a complex suffix after a type suffix (e.g. Fi additionally to just iF).
- Reject multiple complex suffixes (e.g. ii).

11 years agosemantic: Clean up check_integer_suffix().
Christoph Mallon [Mon, 17 Dec 2012 10:19:43 +0000 (11:19 +0100)]
semantic: Clean up check_integer_suffix().

In particular remove the test for the impossible case that *c ist not NUL after the loop.

11 years agoast2firm: Implement casting from complex to real types.
Christoph Mallon [Mon, 17 Dec 2012 11:04:14 +0000 (12:04 +0100)]
ast2firm: Implement casting from complex to real types.

11 years agoparser: Correct source position of select (->, .) expressions.
Christoph Mallon [Sat, 15 Dec 2012 18:43:21 +0000 (19:43 +0100)]
parser: Correct source position of select (->, .) expressions.

11 years agowrite_jna: Simplify fix_builtin_names().
Christoph Mallon [Sat, 15 Dec 2012 11:33:44 +0000 (12:33 +0100)]
write_jna: Simplify fix_builtin_names().

11 years agowrite_jna: Properly check whether a declaration is in a system header.
Christoph Mallon [Sat, 15 Dec 2012 11:32:48 +0000 (12:32 +0100)]
write_jna: Properly check whether a declaration is in a system header.

11 years agocleanup: Reduce variable scope.
Christoph Mallon [Sat, 15 Dec 2012 10:30:51 +0000 (11:30 +0100)]
cleanup: Reduce variable scope.

11 years agowarning: Add the switch -Wsystem to show warnings in system headers.
Christoph Mallon [Sat, 15 Dec 2012 10:24:58 +0000 (11:24 +0100)]
warning: Add the switch -Wsystem to show warnings in system headers.

Warnings in system headers are suppressed by default now.

11 years agosimplify license header similar to libFirm
Matthias Braun [Wed, 12 Dec 2012 18:53:00 +0000 (19:53 +0100)]
simplify license header similar to libFirm

Only state the project and the copyright. The rest can be found in the
COPYING file.

11 years agocleanup: complex conditional creation style
Matthias Braun [Wed, 12 Dec 2012 17:46:16 +0000 (18:46 +0100)]
cleanup: complex conditional creation style

It is now using the same techniques as can be found in the non-complex
code paths.

11 years agocleanup: refactor complex assignment into an own function
Matthias Braun [Wed, 12 Dec 2012 17:45:51 +0000 (18:45 +0100)]
cleanup: refactor complex assignment into an own function

11 years agocleanup: improve coding style
Matthias Braun [Wed, 12 Dec 2012 17:43:06 +0000 (18:43 +0100)]
cleanup: improve coding style

- add some more consts
- remove some unnecessary asserts (which made the code noisy)
- replace an if with ?:

11 years agocleanup: avoid unnecessary complicated code sharing
Matthias Braun [Wed, 12 Dec 2012 17:41:14 +0000 (18:41 +0100)]
cleanup: avoid unnecessary complicated code sharing

11 years agoupdate libfirm revision
Matthias Braun [Mon, 10 Dec 2012 15:42:53 +0000 (16:42 +0100)]
update libfirm revision

11 years agoparser: Parse and reject GCC range initializers "[0 ... 9]".
Christoph Mallon [Wed, 12 Dec 2012 13:07:48 +0000 (14:07 +0100)]
parser: Parse and reject GCC range initializers "[0 ... 9]".

11 years agoparser: Use parse_expression() instead of parse_assignment_expression() where appropr...
Christoph Mallon [Wed, 12 Dec 2012 15:48:58 +0000 (16:48 +0100)]
parser: Use parse_expression() instead of parse_assignment_expression() where appropriate.

11 years agoast2firm: Replace get_store(set_store(x)) by x.
Christoph Mallon [Wed, 12 Dec 2012 15:54:19 +0000 (16:54 +0100)]
ast2firm: Replace get_store(set_store(x)) by x.

11 years agoast2firm: Use conv_to_storage_type().
Christoph Mallon [Wed, 12 Dec 2012 15:51:43 +0000 (16:51 +0100)]
ast2firm: Use conv_to_storage_type().

11 years agoparser: Simplify parse_complex_extract_expression().
Christoph Mallon [Wed, 12 Dec 2012 15:50:11 +0000 (16:50 +0100)]
parser: Simplify parse_complex_extract_expression().

11 years agoparser: Remove redundant assignment.
Christoph Mallon [Wed, 12 Dec 2012 15:38:24 +0000 (16:38 +0100)]
parser: Remove redundant assignment.

allocate_expression_zero() sets the pos.

11 years agoast: Remove redundant test.
Christoph Mallon [Wed, 12 Dec 2012 10:12:54 +0000 (11:12 +0100)]
ast: Remove redundant test.

Complex types are scalar.

11 years agoparser: Remove redundant test.
Christoph Mallon [Wed, 12 Dec 2012 15:37:42 +0000 (16:37 +0100)]
parser: Remove redundant test.

parse_expression() never returns null.

11 years agolibfirm: Update to newer version.
Christoph Mallon [Wed, 12 Dec 2012 09:08:22 +0000 (10:08 +0100)]
libfirm: Update to newer version.

This resolves the assertion, that PIC types miss the segment flag.

11 years agorelational operators are only allowed for real types
Matthias Braun [Tue, 11 Dec 2012 10:34:00 +0000 (11:34 +0100)]
relational operators are only allowed for real types

11 years agoupdate libfirm submodule
Matthias Braun [Tue, 11 Dec 2012 10:21:40 +0000 (11:21 +0100)]
update libfirm submodule

This should avoid some failures when inlining calls with complex
args/results

11 years agoaccept (but warn) '_Complex' without additional specifiers
Matthias Braun [Tue, 11 Dec 2012 10:07:28 +0000 (11:07 +0100)]
accept (but warn) '_Complex' without additional specifiers

11 years agoimplement statement expressions for complex values
Matthias Braun [Tue, 11 Dec 2012 10:03:24 +0000 (11:03 +0100)]
implement statement expressions for complex values

11 years agodo not warn for missing declarations if type is invalid
Matthias Braun [Tue, 11 Dec 2012 10:02:57 +0000 (11:02 +0100)]
do not warn for missing declarations if type is invalid

11 years agocomplex bitops are not allowed even for _Complex int
Matthias Braun [Mon, 10 Dec 2012 23:01:47 +0000 (00:01 +0100)]
complex bitops are not allowed even for _Complex int

11 years agoimplement support for complex types
Matthias Braun [Mon, 10 Dec 2012 15:35:47 +0000 (16:35 +0100)]
implement support for complex types

Not tested that much yet, and support for statement expressions is still
missing.

11 years agofix TODO
Matthias Braun [Wed, 5 Dec 2012 22:31:48 +0000 (23:31 +0100)]
fix TODO

11 years agorename bitwise_negate to complement
Matthias Braun [Thu, 6 Dec 2012 12:25:51 +0000 (13:25 +0100)]
rename bitwise_negate to complement

11 years agofix coding style
Matthias Braun [Wed, 5 Dec 2012 23:05:38 +0000 (00:05 +0100)]
fix coding style

11 years agoupdate libfirm revision
Matthias Braun [Mon, 10 Dec 2012 15:42:53 +0000 (16:42 +0100)]
update libfirm revision

11 years agoast2firm: When the result of ?: is unreachable, create a Bad value, not Unknown.
Christoph Mallon [Mon, 10 Dec 2012 14:48:18 +0000 (15:48 +0100)]
ast2firm: When the result of ?: is unreachable, create a Bad value, not Unknown.

11 years agoast2firm: Convert operands to the arithmetic mode, not results.
Christoph Mallon [Sun, 9 Dec 2012 22:27:57 +0000 (23:27 +0100)]
ast2firm: Convert operands to the arithmetic mode, not results.

This is a bit simpler and avoids several pointless conversions in float calculations.

11 years agoast2firm: Rewrite IR construction for expressions.
Christoph Mallon [Sun, 9 Dec 2012 10:11:43 +0000 (11:11 +0100)]
ast2firm: Rewrite IR construction for expressions.

11 years agoast2firm: There is no sensible IR type to create for void, so do not do it.
Christoph Mallon [Mon, 10 Dec 2012 07:12:19 +0000 (08:12 +0100)]
ast2firm: There is no sensible IR type to create for void, so do not do it.

11 years agosemantic: Add missing skip_typeref() to avoid adding unnecessary implicit casts.
Christoph Mallon [Mon, 10 Dec 2012 07:05:00 +0000 (08:05 +0100)]
semantic: Add missing skip_typeref() to avoid adding unnecessary implicit casts.

In particular this avoids insertion of non-scalar nop casts.
Therefore some tests, which later skip them, are removed, too.

11 years agoast2firm: Remove unnecessary special case handling for constant folding.
Christoph Mallon [Sun, 9 Dec 2012 17:41:46 +0000 (18:41 +0100)]
ast2firm: Remove unnecessary special case handling for constant folding.

In particular the case in conditional_to_firm() should be covered by jump target handling.

11 years agoast2firm: Remove the thin wrapper function set_value_for_expression().
Christoph Mallon [Sun, 9 Dec 2012 10:09:19 +0000 (11:09 +0100)]
ast2firm: Remove the thin wrapper function set_value_for_expression().

11 years agoast2firm: Remove nonsensical case: You cannot take the address of a function call...
Christoph Mallon [Sun, 9 Dec 2012 09:06:15 +0000 (10:06 +0100)]
ast2firm: Remove nonsensical case: You cannot take the address of a function call result.

11 years agoast2firm: Use the value returned by set_value_for_expression_addr() as return value...
Christoph Mallon [Sun, 9 Dec 2012 09:50:49 +0000 (10:50 +0100)]
ast2firm: Use the value returned by set_value_for_expression_addr() as return value for prefix ++/--.

- This is important for bitfields, which contain fewer bits than the to be stored value has.
- This is important for float variables, when the calculation is done in higher precision.

11 years agoast2firm: Clean up create_incdec().
Christoph Mallon [Sat, 8 Dec 2012 22:17:47 +0000 (23:17 +0100)]
ast2firm: Clean up create_incdec().

11 years agoast2firm: Factorise code to convert a value to its storage type.
Christoph Mallon [Sat, 8 Dec 2012 11:18:48 +0000 (12:18 +0100)]
ast2firm: Factorise code to convert a value to its storage type.

11 years agocleanup: Remove unused typedef.
Christoph Mallon [Sat, 8 Dec 2012 09:57:26 +0000 (10:57 +0100)]
cleanup: Remove unused typedef.

11 years agotype: Add missing space for printing complex types.
Christoph Mallon [Fri, 7 Dec 2012 12:42:55 +0000 (13:42 +0100)]
type: Add missing space for printing complex types.

11 years agoAdapt to latest libfirm: "nooptcc=yes" is "optcc=false" now.
Christoph Mallon [Thu, 6 Dec 2012 14:31:22 +0000 (15:31 +0100)]
Adapt to latest libfirm: "nooptcc=yes" is "optcc=false" now.

11 years agoadapt to latest libfirm
Matthias Braun [Tue, 4 Dec 2012 17:26:16 +0000 (18:26 +0100)]
adapt to latest libfirm

11 years agosupport complex type (no arithmetic yet)
Matthias Braun [Thu, 29 Nov 2012 09:49:36 +0000 (10:49 +0100)]
support complex type (no arithmetic yet)

11 years agoFixed some typos.
Sebastian Buchwald [Mon, 3 Dec 2012 07:30:30 +0000 (08:30 +0100)]
Fixed some typos.

11 years agorename source_position_t to position_t, rename members to pos
Matthias Braun [Sat, 1 Dec 2012 14:27:26 +0000 (15:27 +0100)]
rename source_position_t to position_t, rename members to pos

11 years agopreprocessor: Do not use uninitialized values for the column in error messages.
Christoph Mallon [Thu, 29 Nov 2012 22:13:09 +0000 (23:13 +0100)]
preprocessor: Do not use uninitialized values for the column in error messages.

11 years agodo not fail when initializing tokens multiple times
Matthias Braun [Wed, 28 Nov 2012 14:33:53 +0000 (15:33 +0100)]
do not fail when initializing tokens multiple times

11 years agofix cases where compoundlits are constant/get an entity
Matthias Braun [Wed, 28 Nov 2012 12:29:38 +0000 (13:29 +0100)]
fix cases where compoundlits are constant/get an entity

This is possible when they are in global scope (and have a constant
initializers anyway) or when they have a const type and constant
initializers.

11 years agoimplement -Wa, -Xlinker, -Xpreprocessor, -Xassembler
Matthias Braun [Tue, 27 Nov 2012 08:36:12 +0000 (09:36 +0100)]
implement -Wa, -Xlinker, -Xpreprocessor, -Xassembler

11 years agodon't grow the hashset if it just clobbered with deleted entries
Matthias Braun [Mon, 26 Nov 2012 16:12:29 +0000 (17:12 +0100)]
don't grow the hashset if it just clobbered with deleted entries

11 years agoadapt to change firmstat settings
Matthias Braun [Mon, 26 Nov 2012 14:07:07 +0000 (15:07 +0100)]
adapt to change firmstat settings

11 years agosupport compound values in dynamic initializers
Matthias Braun [Sat, 24 Nov 2012 16:36:26 +0000 (17:36 +0100)]
support compound values in dynamic initializers

11 years agoparser: Remove extra '' around %K in an error message.
Christoph Mallon [Sat, 24 Nov 2012 09:32:34 +0000 (10:32 +0100)]
parser: Remove extra '' around %K in an error message.

11 years agotimer: Enlarge the display space for description and time.
Christoph Mallon [Fri, 23 Nov 2012 06:42:49 +0000 (07:42 +0100)]
timer: Enlarge the display space for description and time.

11 years agosupport compound literals as initializers
Matthias Braun [Thu, 22 Nov 2012 21:46:34 +0000 (22:46 +0100)]
support compound literals as initializers

11 years agosemantic: Improve error messages.
Christoph Mallon [Thu, 22 Nov 2012 13:36:06 +0000 (14:36 +0100)]
semantic: Improve error messages.

11 years agosemantic: The operands of % must be integer, not just arithmetic.
Christoph Mallon [Thu, 22 Nov 2012 11:23:00 +0000 (12:23 +0100)]
semantic: The operands of % must be integer, not just arithmetic.

11 years agocleanup: Remove redundant assignment.
Christoph Mallon [Wed, 21 Nov 2012 20:22:09 +0000 (21:22 +0100)]
cleanup: Remove redundant assignment.

allocate_entity_zero() sets the source position already.

11 years agoast2firm: Keep the ijmp block and memory.
Christoph Mallon [Wed, 21 Nov 2012 15:42:49 +0000 (16:42 +0100)]
ast2firm: Keep the ijmp block and memory.

It might be an (endless) loop header.

11 years agoupdate for new release
Matthias Braun [Fri, 16 Nov 2012 18:08:30 +0000 (19:08 +0100)]
update for new release

11 years agofix "make bootstrap" with libfirm submodule
Matthias Braun [Wed, 21 Nov 2012 16:47:09 +0000 (17:47 +0100)]
fix "make bootstrap" with libfirm submodule

11 years agofold all nodes in the constant code irg regardless of opt settings
Matthias Braun [Mon, 19 Nov 2012 16:59:02 +0000 (17:59 +0100)]
fold all nodes in the constant code irg regardless of opt settings

11 years agoupdate libfirm revision
Matthias Braun [Fri, 16 Nov 2012 17:54:11 +0000 (18:54 +0100)]
update libfirm revision

11 years agomain: rework preprocessor invocation
Matthias Braun [Thu, 15 Nov 2012 18:38:06 +0000 (19:38 +0100)]
main: rework preprocessor invocation

- reintroduce the -x assembler-with-cpp support
- fix wrong output directory for -MMD,-MD switches
- do not output various c-flags for assembler cpp anymore