cparser
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

11 years agodiagnostic: Use errorf(NULL, "[...]") instead of fprintf(stderr, "error: [...]\n").
Christoph Mallon [Fri, 9 Nov 2012 08:41:45 +0000 (09:41 +0100)]
diagnostic: Use errorf(NULL, "[...]") instead of fprintf(stderr, "error: [...]\n").

11 years agodiagnostic: Allow passing no position or only a filename to diagnosticposvf().
Christoph Mallon [Fri, 9 Nov 2012 08:38:10 +0000 (09:38 +0100)]
diagnostic: Allow passing no position or only a filename to diagnosticposvf().

11 years agoinput: Simplify choose_decoder().
Christoph Mallon [Fri, 9 Nov 2012 08:46:05 +0000 (09:46 +0100)]
input: Simplify choose_decoder().

11 years agoMakefile: cleanup, rewrite, add coverage variant
Matthias Braun [Sat, 10 Nov 2012 17:03:18 +0000 (18:03 +0100)]
Makefile: cleanup, rewrite, add coverage variant

Makes the style more similar to the one used in libfirm. Add build
variant for coverage testing.

11 years agoRemove \n from error messages.
Christoph Mallon [Fri, 9 Nov 2012 07:16:51 +0000 (08:16 +0100)]
Remove \n from error messages.

11 years agoAdd missing \n after printing a warning when using -fno-diagnostics-show-option.
Christoph Mallon [Fri, 9 Nov 2012 08:16:27 +0000 (09:16 +0100)]
Add missing \n after printing a warning when using -fno-diagnostics-show-option.

11 years agoParse (and reject) asm goto.
Christoph Mallon [Fri, 26 Oct 2012 05:03:24 +0000 (07:03 +0200)]
Parse (and reject) asm goto.

11 years agoImprove error recovery when parsing asm statements by adding more anchors.
Christoph Mallon [Thu, 8 Nov 2012 13:56:43 +0000 (14:56 +0100)]
Improve error recovery when parsing asm statements by adding more anchors.

11 years agoReject trailing commas when parsing asm argument and clobber lists.
Christoph Mallon [Thu, 8 Nov 2012 13:32:46 +0000 (14:32 +0100)]
Reject trailing commas when parsing asm argument and clobber lists.

11 years agoSimplify passing passing the results of parse_asm_arguments() and parse_asm_clobbers().
Christoph Mallon [Thu, 8 Nov 2012 13:25:08 +0000 (14:25 +0100)]
Simplify passing passing the results of parse_asm_arguments() and parse_asm_clobbers().

11 years agoImprove error recovery in parse_asm_arguments().
Christoph Mallon [Thu, 8 Nov 2012 13:23:02 +0000 (14:23 +0100)]
Improve error recovery in parse_asm_arguments().

There is not need to abort parsing arguments, if we failed to parse the name for an asm argument.

11 years agoMake printing asm statements a bit nicer by using fewer spaces.
Christoph Mallon [Thu, 8 Nov 2012 07:46:46 +0000 (08:46 +0100)]
Make printing asm statements a bit nicer by using fewer spaces.

11 years agoClean up print_asm_statement().
Christoph Mallon [Thu, 8 Nov 2012 08:44:40 +0000 (09:44 +0100)]
Clean up print_asm_statement().

11 years agoAdd separator_t to aid printing lists with separators.
Christoph Mallon [Wed, 28 Mar 2012 07:10:29 +0000 (09:10 +0200)]
Add separator_t to aid printing lists with separators.

11 years agoRename next_if() to accept() and document it.
Christoph Mallon [Wed, 7 Nov 2012 14:15:59 +0000 (15:15 +0100)]
Rename next_if() to accept() and document it.

11 years agoOnly produce an error about the type of an array subscript, if the type is valid.
Christoph Mallon [Thu, 8 Nov 2012 03:58:39 +0000 (04:58 +0100)]
Only produce an error about the type of an array subscript, if the type is valid.

11 years agoCheck for constant conditions in create_condition_evaluation().
Christoph Mallon [Wed, 7 Nov 2012 08:07:12 +0000 (09:07 +0100)]
Check for constant conditions in create_condition_evaluation().

If the condition was folded to a constant, then make an unconditional jump to the appropriate target instead of constructing a Cond.
This avoids further unnecessary basic blocks and Bad nodes.

11 years agoReduce scope of variable.
Christoph Mallon [Wed, 7 Nov 2012 07:39:15 +0000 (08:39 +0100)]
Reduce scope of variable.

11 years agoKeep all loops, because they could become infinite.
Christoph Mallon [Tue, 6 Nov 2012 14:56:59 +0000 (15:56 +0100)]
Keep all loops, because they could become infinite.

11 years agoImplement U, u and u8 strings.
Christoph Mallon [Sat, 27 Oct 2012 18:58:19 +0000 (20:58 +0200)]
Implement U, u and u8 strings.

11 years agoLet panic() print file, line and function.
Christoph Mallon [Sat, 27 Oct 2012 13:19:22 +0000 (15:19 +0200)]
Let panic() print file, line and function.

Adjust some panic messages accordingly.

11 years agoRoute all computed goto statements of a function through one IJmp.
Christoph Mallon [Fri, 26 Oct 2012 09:26:00 +0000 (11:26 +0200)]
Route all computed goto statements of a function through one IJmp.

This avoids the unsplitable critical edges, if there multiple computed goto statements.

11 years agoUse jump_target for goto labels.
Christoph Mallon [Fri, 26 Oct 2012 09:00:37 +0000 (11:00 +0200)]
Use jump_target for goto labels.

This saves an unnecessary block, if only a single forward jump reaches a label.

11 years agoUse a separate block as target for indirect jumps.
Christoph Mallon [Fri, 26 Oct 2012 08:43:52 +0000 (10:43 +0200)]
Use a separate block as target for indirect jumps.

This is a preparation for using jump_targets for labels and avoiding critical edges at indirect jumps.

11 years agoReplace jump_if_reachable() by jump_targets.
Christoph Mallon [Fri, 26 Oct 2012 08:01:02 +0000 (10:01 +0200)]
Replace jump_if_reachable() by jump_targets.

11 years agoUse jump_target for conditional jumps.
Christoph Mallon [Fri, 26 Oct 2012 07:57:34 +0000 (09:57 +0200)]
Use jump_target for conditional jumps.

11 years agoUse jump_target for break.
Christoph Mallon [Fri, 26 Oct 2012 06:48:11 +0000 (08:48 +0200)]
Use jump_target for break.

This saves an unnecessary block, if a loop/switch is only left via a single break.

11 years agoUse jump_target for continue.
Christoph Mallon [Fri, 26 Oct 2012 06:20:05 +0000 (08:20 +0200)]
Use jump_target for continue.

- This saves an unnecessary block in for-loops, if the step is only reached by one source.
- This saves an unnecessary block in do-while-loops, if the condition is only reached by one source.

11 years agoUse jump_target to simplify the implementation of if_statement_to_firm().
Christoph Mallon [Fri, 26 Oct 2012 05:56:42 +0000 (07:56 +0200)]
Use jump_target to simplify the implementation of if_statement_to_firm().

11 years agoAdd jump_targets as general mechanism to avoid unnecessary basic blocks.
Christoph Mallon [Fri, 26 Oct 2012 05:56:26 +0000 (07:56 +0200)]
Add jump_targets as general mechanism to avoid unnecessary basic blocks.

11 years agouse ir_tarval to calculate case values
Matthias Braun [Wed, 24 Oct 2012 16:22:42 +0000 (18:22 +0200)]
use ir_tarval to calculate case values

This avoids problems when handling unsigned long long case values in
the parser, which formerly only used long/int.
Fixes 64bit switches in combination with new libfirm.

11 years agoRemove typedefs of non-existent structs.
Christoph Mallon [Thu, 25 Oct 2012 10:50:29 +0000 (12:50 +0200)]
Remove typedefs of non-existent structs.

11 years agoUse a reference counter to mature label blocks as early as possible.
Christoph Mallon [Wed, 24 Oct 2012 11:58:55 +0000 (13:58 +0200)]
Use a reference counter to mature label blocks as early as possible.

11 years agoProcess the inner statement of a case label, even if the case range is empty.
Christoph Mallon [Wed, 24 Oct 2012 12:01:01 +0000 (14:01 +0200)]
Process the inner statement of a case label, even if the case range is empty.

The inner statement might be reachable by other (case) labels.

11 years agoAdd missing EXPR_LITERAL_MS_NOOP in get_expression_struct_size().
Christoph Mallon [Wed, 24 Oct 2012 10:34:34 +0000 (12:34 +0200)]
Add missing EXPR_LITERAL_MS_NOOP in get_expression_struct_size().

11 years agoRemove -pedantic.
Christoph Mallon [Wed, 24 Oct 2012 14:51:51 +0000 (16:51 +0200)]
Remove -pedantic.

gcc is quite inconsistent with this and we do not use it for libfirm either.

11 years agouse statev in cparser
Matthias Braun [Wed, 24 Oct 2012 11:41:58 +0000 (13:41 +0200)]
use statev in cparser

- Adds a --statev and --filtev=XXX flag to cparser
- Output some phase timings and the number of nodes after construction
  as statevs

11 years agoadapt to new timer API
Matthias Braun [Mon, 15 Oct 2012 17:09:35 +0000 (19:09 +0200)]
adapt to new timer API

11 years agoadd a phase that optimizes the const-code-irg
Matthias Braun [Mon, 15 Oct 2012 17:05:00 +0000 (19:05 +0200)]
add a phase that optimizes the const-code-irg

11 years agoclang static analyzer warning fixes
Matthias Braun [Sun, 14 Oct 2012 19:45:08 +0000 (21:45 +0200)]
clang static analyzer warning fixes

11 years agoadapt to method property changes
Matthias Braun [Tue, 25 Sep 2012 16:49:39 +0000 (18:49 +0200)]
adapt to method property changes

11 years agoexplicitely set long long/unsigned long long/double alignment on windows
Matthias Braun [Mon, 17 Sep 2012 11:10:47 +0000 (13:10 +0200)]
explicitely set long long/unsigned long long/double alignment on windows

11 years agoMove changing current_ir_graph from get_label_block() to the only caller needing it.
Christoph Mallon [Mon, 22 Oct 2012 10:56:33 +0000 (12:56 +0200)]
Move changing current_ir_graph from get_label_block() to the only caller needing it.

11 years agoWrap changing current_ir_graph in {PUSH,POP}_IRG().
Christoph Mallon [Mon, 22 Oct 2012 10:55:10 +0000 (12:55 +0200)]
Wrap changing current_ir_graph in {PUSH,POP}_IRG().

11 years agoAvoid an unnecessary basic block in case of do ... while (0);.
Christoph Mallon [Thu, 18 Oct 2012 09:09:27 +0000 (11:09 +0200)]
Avoid an unnecessary basic block in case of do ... while (0);.

11 years agoWrap changing {break,continue}_label in {PUSH,POP}_{BREAK,CONTINUE}.
Christoph Mallon [Thu, 18 Oct 2012 13:38:50 +0000 (15:38 +0200)]
Wrap changing {break,continue}_label in {PUSH,POP}_{BREAK,CONTINUE}.

11 years agoLet jump_to() handle setting the current block.
Christoph Mallon [Thu, 18 Oct 2012 07:47:08 +0000 (09:47 +0200)]
Let jump_to() handle setting the current block.

11 years agoRename the member statement of struct function_t to body.
Christoph Mallon [Thu, 18 Oct 2012 07:37:43 +0000 (09:37 +0200)]
Rename the member statement of struct function_t to body.

11 years agoCheck whether a local variable needs an entity more systematically.
Christoph Mallon [Thu, 18 Oct 2012 07:22:44 +0000 (09:22 +0200)]
Check whether a local variable needs an entity more systematically.

11 years agoRemove unused members from struct compound_member_t and struct variable_t.
Christoph Mallon [Wed, 17 Oct 2012 11:49:21 +0000 (13:49 +0200)]
Remove unused members from struct compound_member_t and struct variable_t.

11 years agoAttach debug info to parameter entities/projs.
Christoph Mallon [Wed, 17 Oct 2012 11:47:13 +0000 (13:47 +0200)]
Attach debug info to parameter entities/projs.

11 years agoadded undefine of __BLOCKS__ macro that is set by cpp under Mac OS 10.7
Sebastian Hack [Thu, 13 Sep 2012 11:58:53 +0000 (13:58 +0200)]
added undefine of __BLOCKS__ macro that is set by cpp under Mac OS 10.7

11 years agoRemove object files instead of whole build dir when cleaning.
Manuel Mohr [Fri, 7 Sep 2012 07:18:10 +0000 (09:18 +0200)]
Remove object files instead of whole build dir when cleaning.

Strangely enough, the old way of running rm -rf $(BUILDDIR)/ did not
work if BUILDDIR was a symbolic link.  In this case, the rm command was
a nop.  rm -rf $(BUILDDIR) would have removed the symbolic link whereas
rm -rf $(BUILDDIR)/* would have removed all directory contents.  We
adopt libfirm's strategy and remove all object files while leaving the
dep files intact.

11 years agoDon't make libfirm when cleaning cparser.
Manuel Mohr [Thu, 6 Sep 2012 14:27:55 +0000 (16:27 +0200)]
Don't make libfirm when cleaning cparser.

11 years agoRemove the AST node for while, use the one for for instead.
Christoph Mallon [Wed, 8 Aug 2012 06:23:05 +0000 (08:23 +0200)]
Remove the AST node for while, use the one for for instead.

This removes quite a bit of code duplication.

11 years agoFixed clang warning.
Sebastian Buchwald [Thu, 30 Aug 2012 08:28:57 +0000 (10:28 +0200)]
Fixed clang warning.

11 years agostrictconv is not necessary anymore in latest firm
Matthias Braun [Tue, 21 Aug 2012 14:50:37 +0000 (16:50 +0200)]
strictconv is not necessary anymore in latest firm

11 years agocparser knowns unroll loops
Matthias Braun [Fri, 10 Aug 2012 12:15:47 +0000 (14:15 +0200)]
cparser knowns unroll loops

11 years agoimproved fix for integer expression printing
Matthias Braun [Thu, 26 Jul 2012 17:21:09 +0000 (19:21 +0200)]
improved fix for integer expression printing

11 years agoonly output digits in integer literals in write_jna
Matthias Braun [Thu, 26 Jul 2012 14:13:02 +0000 (16:13 +0200)]
only output digits in integer literals in write_jna

11 years agoNew output mode to generate size (in bytes) of some compound types
Matthias Braun [Thu, 26 Jul 2012 13:51:30 +0000 (15:51 +0200)]
New output mode to generate size (in bytes) of some compound types

This will be used by the X10 native code integration.

11 years agorememeber attributes on struct types
Matthias Braun [Thu, 26 Jul 2012 13:51:07 +0000 (15:51 +0200)]
rememeber attributes on struct types

11 years agofix memory error
Matthias Braun [Mon, 23 Jul 2012 13:11:19 +0000 (15:11 +0200)]
fix memory error

11 years agoadapt to libFirm ASM changes
Matthias Braun [Mon, 23 Jul 2012 12:56:15 +0000 (14:56 +0200)]
adapt to libFirm ASM changes

11 years agoadd a special case for __attribute__((__const))
Matthias Braun [Wed, 18 Jul 2012 08:50:16 +0000 (10:50 +0200)]
add a special case for __attribute__((__const))

according to gcc documentation only "__XXX__" and "XXX" should be
allowed for attribute names, but it seems gcc incorrectly also accepts
__XXX for keywords with an __XXX variant. And of course some glibc
headers use this feature.

11 years agofix -fsyntax-only
Matthias Braun [Wed, 18 Jul 2012 08:50:05 +0000 (10:50 +0200)]
fix -fsyntax-only

11 years agofix bad include after renaming
Matthias Braun [Mon, 16 Jul 2012 16:13:13 +0000 (18:13 +0200)]
fix bad include after renaming

11 years agoadd missing file to Makefile
Matthias Braun [Mon, 16 Jul 2012 16:10:47 +0000 (18:10 +0200)]
add missing file to Makefile

11 years agoRename hashset.c to hashset.c.inl.
Christoph Mallon [Mon, 16 Jul 2012 15:04:19 +0000 (17:04 +0200)]
Rename hashset.c to hashset.c.inl.

11 years agoprovide our own hashset implementation
Matthias Braun [Mon, 16 Jul 2012 14:40:15 +0000 (16:40 +0200)]
provide our own hashset implementation

We want to be independent of libfirms containertypes (as they may get
deprecated at some point).
The implementation we use is a copy of libfirm :)

11 years agorespect getcwd return value
Matthias Braun [Fri, 13 Jul 2012 21:09:08 +0000 (23:09 +0200)]
respect getcwd return value

this fixes a warning

11 years agoimplement is_universal_char_valid_identifier_c99
Matthias Braun [Fri, 13 Jul 2012 12:16:49 +0000 (14:16 +0200)]
implement is_universal_char_valid_identifier_c99

11 years agoOnly classify several expressions as constant if no error is involved.
Christoph Mallon [Mon, 9 Jul 2012 10:35:53 +0000 (12:35 +0200)]
Only classify several expressions as constant if no error is involved.