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

11 years agoAdd the option c11 to -std and add the C11 keywords.
Christoph Mallon [Mon, 9 Jul 2012 09:55:23 +0000 (11:55 +0200)]
Add the option c11 to -std and add the C11 keywords.

- Use _Thread_local instead of __thread internally.
- Use _Alignof instead of __alignof__ internally.

11 years agoImplement -idirafter.
Christoph Mallon [Mon, 9 Jul 2012 07:52:49 +0000 (09:52 +0200)]
Implement -idirafter.

11 years agoRecord and handle, whether a search path is a system path.
Christoph Mallon [Mon, 2 Jul 2012 16:38:02 +0000 (18:38 +0200)]
Record and handle, whether a search path is a system path.

11 years agobetter search paths handling; respect -I
Matthias Braun [Thu, 5 Jul 2012 18:13:00 +0000 (20:13 +0200)]
better search paths handling; respect -I

11 years agobugfix for external non-emitting API
Matthias Braun [Thu, 5 Jul 2012 16:33:02 +0000 (18:33 +0200)]
bugfix for external non-emitting API

11 years agowhitespace before tokens affects macro redef
Matthias Braun [Wed, 6 Jun 2012 17:52:19 +0000 (19:52 +0200)]
whitespace before tokens affects macro redef

11 years agoimplement includefile macro expansion
Matthias Braun [Sun, 3 Jun 2012 14:01:38 +0000 (16:01 +0200)]
implement includefile macro expansion

11 years agoshow additional space before macro expanded '#'
Matthias Braun [Sat, 26 May 2012 07:28:19 +0000 (09:28 +0200)]
show additional space before macro expanded '#'

gcc/clang output an additional space before a (macro-expanded) '#' at
line begin. So we replicate this behaviour.

11 years agopreprocessor: implement stringify operation '#'
Matthias Braun [Fri, 25 May 2012 17:30:39 +0000 (19:30 +0200)]
preprocessor: implement stringify operation '#'

11 years agoSimplify peek_expansion().
Christoph Mallon [Sun, 1 Jul 2012 07:28:33 +0000 (09:28 +0200)]
Simplify peek_expansion().

11 years agopreprocessor: output '3' flag for system headers
Matthias Braun [Mon, 18 Jun 2012 23:12:51 +0000 (01:12 +0200)]
preprocessor: output '3' flag for system headers

11 years agoImplement #include_next.
Christoph Mallon [Sun, 1 Jul 2012 06:40:29 +0000 (08:40 +0200)]
Implement #include_next.

11 years agoTest skip_mode in parse_pragma_directive().
Christoph Mallon [Mon, 2 Jul 2012 16:59:29 +0000 (18:59 +0200)]
Test skip_mode in parse_pragma_directive().

11 years agoProperly test for a valid identifer after #define and #undef.
Christoph Mallon [Fri, 29 Jun 2012 18:05:53 +0000 (20:05 +0200)]
Properly test for a valid identifer after #define and #undef.

11 years agoReimplement input_error(), which got lost with the old lexer.
Christoph Mallon [Fri, 22 Jun 2012 20:39:26 +0000 (22:39 +0200)]
Reimplement input_error(), which got lost with the old lexer.

11 years agoImplement #error.
Christoph Mallon [Fri, 22 Jun 2012 09:29:19 +0000 (11:29 +0200)]
Implement #error.

11 years agoCorrect do_include().
Christoph Mallon [Fri, 6 Jul 2012 09:09:59 +0000 (11:09 +0200)]
Correct do_include().

Do not alter headername, which is needed unaltered later on.

11 years agoRemove pointless local variable.
Christoph Mallon [Fri, 6 Jul 2012 09:01:53 +0000 (11:01 +0200)]
Remove pointless local variable.

11 years agoRemove redundante fclose(), which is handles by close_input() a few lines later.
Christoph Mallon [Fri, 6 Jul 2012 08:59:05 +0000 (10:59 +0200)]
Remove redundante fclose(), which is handles by close_input() a few lines later.

11 years agoAlways reset unit->input in close_input().
Christoph Mallon [Fri, 6 Jul 2012 09:00:46 +0000 (11:00 +0200)]
Always reset unit->input in close_input().

11 years agorework compilation loop, use our preproc for -E
Matthias Braun [Thu, 5 Jul 2012 16:19:27 +0000 (18:19 +0200)]
rework compilation loop, use our preproc for -E

also removed --lextest which was broken and not really usefull anymore

11 years agomake pp_token emit API public
Matthias Braun [Thu, 5 Jul 2012 15:57:27 +0000 (17:57 +0200)]
make pp_token emit API public

11 years agoAvoid endless loop when encountering EOF while parsing an initializer.
Christoph Mallon [Thu, 5 Jul 2012 06:57:58 +0000 (08:57 +0200)]
Avoid endless loop when encountering EOF while parsing an initializer.

11 years agoPlug a memory leak (and reduce code duplication) for string initializers with extra...
Christoph Mallon [Thu, 5 Jul 2012 06:33:55 +0000 (08:33 +0200)]
Plug a memory leak (and reduce code duplication) for string initializers with extra curly braces.

11 years agoShow the right type when warning about excessive initializer elements.
Christoph Mallon [Thu, 5 Jul 2012 06:33:29 +0000 (08:33 +0200)]
Show the right type when warning about excessive initializer elements.

11 years agofix line-directive parser
Matthias Braun [Wed, 4 Jul 2012 12:45:30 +0000 (14:45 +0200)]
fix line-directive parser

It was happily eating tokens from the following lines as long as they
were numbers and strings.

11 years agodo NOT use #if for target platform decisions
Matthias Braun [Wed, 4 Jul 2012 09:11:18 +0000 (11:11 +0200)]
do NOT use #if for target platform decisions

(or we will end up like gcc where you have to compile each host/target
 combination again, instead of having 1 compiler which can produce
 everything)

11 years agoremove unnecessary ATOMIC_TYPE_INVALID
Matthias Braun [Tue, 3 Jul 2012 10:47:20 +0000 (12:47 +0200)]
remove unnecessary ATOMIC_TYPE_INVALID

11 years agoslightly simplify wchar_t handling
Matthias Braun [Tue, 3 Jul 2012 10:38:21 +0000 (12:38 +0200)]
slightly simplify wchar_t handling

11 years agoProperly support -ansi.
Christoph Mallon [Tue, 3 Jul 2012 14:55:44 +0000 (16:55 +0200)]
Properly support -ansi.

11 years agoDocument -std=c90 in the manpage.
Christoph Mallon [Tue, 3 Jul 2012 14:54:56 +0000 (16:54 +0200)]
Document -std=c90 in the manpage.

11 years agoAdded documentation for -std=c90.
Sebastian Buchwald [Tue, 3 Jul 2012 14:05:51 +0000 (16:05 +0200)]
Added documentation for -std=c90.

11 years agoAdd -std=c90 as alias for -std=c89.
Christoph Mallon [Tue, 3 Jul 2012 14:32:58 +0000 (16:32 +0200)]
Add -std=c90 as alias for -std=c89.

11 years agoFactorise conversion from lang_standard_t to a string into a function.
Christoph Mallon [Tue, 3 Jul 2012 14:29:53 +0000 (16:29 +0200)]
Factorise conversion from lang_standard_t to a string into a function.

11 years agoFixed warning for -std=iso9899:199409.
Sebastian Buchwald [Tue, 3 Jul 2012 13:54:04 +0000 (15:54 +0200)]
Fixed warning for -std=iso9899:199409.

11 years agoRenamed enum entry.
Sebastian Buchwald [Tue, 3 Jul 2012 13:49:37 +0000 (15:49 +0200)]
Renamed enum entry.

11 years agoUse obstack_copy() instead of obstack_alloc() + memcpy().
Christoph Mallon [Tue, 3 Jul 2012 11:15:44 +0000 (13:15 +0200)]
Use obstack_copy() instead of obstack_alloc() + memcpy().

11 years agoRemove the token registration macro TS.
Christoph Mallon [Tue, 3 Jul 2012 10:52:24 +0000 (12:52 +0200)]
Remove the token registration macro TS.

T is sufficient.

11 years agoConcatenate T_ earlier to the token names.
Christoph Mallon [Tue, 3 Jul 2012 10:43:17 +0000 (12:43 +0200)]
Concatenate T_ earlier to the token names.

This way we get rid of many #undef, which were necessary, because several token names are macros in system headers.

11 years agoRemove _ANSI.
Christoph Mallon [Tue, 3 Jul 2012 10:26:07 +0000 (12:26 +0200)]
Remove _ANSI.

It should be just another word for _C89, but wasn't.

11 years agofix warning
Matthias Braun [Thu, 21 Jun 2012 09:10:21 +0000 (11:10 +0200)]
fix warning

11 years agoReplace the old lexer by the new preprocessor.
Christoph Mallon [Wed, 20 Jun 2012 19:43:35 +0000 (21:43 +0200)]
Replace the old lexer by the new preprocessor.

11 years agocopy dollar in identifier feature from lexer
Matthias Braun [Tue, 19 Jun 2012 00:24:06 +0000 (02:24 +0200)]
copy dollar in identifier feature from lexer

11 years agocopy universal character parsing from lexer
Matthias Braun [Tue, 19 Jun 2012 00:08:09 +0000 (02:08 +0200)]
copy universal character parsing from lexer

11 years agocopy line and pragma directive parsers from lexer
Matthias Braun [Mon, 18 Jun 2012 23:13:15 +0000 (01:13 +0200)]
copy line and pragma directive parsers from lexer

11 years agoimplement macro calling
Matthias Braun [Mon, 21 May 2012 23:58:52 +0000 (01:58 +0200)]
implement macro calling

11 years agomove sym_anonymous to symbol.h
Matthias Braun [Sat, 19 May 2012 14:28:29 +0000 (16:28 +0200)]
move sym_anonymous to symbol.h

11 years agopreprocessor: scanning for :: token was missing
Matthias Braun [Sun, 27 May 2012 22:10:21 +0000 (00:10 +0200)]
preprocessor: scanning for :: token was missing

11 years agoalways set symbol for non-literal tokens
Matthias Braun [Fri, 25 May 2012 16:29:50 +0000 (18:29 +0200)]
always set symbol for non-literal tokens

This now also allows to differentiate digraphs from their replacement in
the preprocessor output

11 years agoSimplify MAYBE macros.
Christoph Mallon [Wed, 20 Jun 2012 13:56:15 +0000 (15:56 +0200)]
Simplify MAYBE macros.

11 years agoCorrect indentation.
Christoph Mallon [Wed, 20 Jun 2012 13:43:28 +0000 (15:43 +0200)]
Correct indentation.

11 years agoTurn T_EOF into a properly registered token.
Christoph Mallon [Wed, 20 Jun 2012 14:58:05 +0000 (16:58 +0200)]
Turn T_EOF into a properly registered token.

11 years agoRewrite print_token().
Christoph Mallon [Wed, 20 Jun 2012 15:37:18 +0000 (17:37 +0200)]
Rewrite print_token().

11 years agopreprocessor: keep unknown chars in preproc mode
Matthias Braun [Fri, 25 May 2012 17:59:03 +0000 (19:59 +0200)]
preprocessor: keep unknown chars in preproc mode

11 years agoRemove the unused return value from parse_include_directive().
Christoph Mallon [Wed, 20 Jun 2012 12:09:40 +0000 (14:09 +0200)]
Remove the unused return value from parse_include_directive().

11 years agoReplace !is_ifndef by is_ifdef.
Christoph Mallon [Wed, 20 Jun 2012 10:16:04 +0000 (12:16 +0200)]
Replace !is_ifndef by is_ifdef.

11 years agoAdd eat_token() for more clarity in the preprocessor.
Christoph Mallon [Wed, 20 Jun 2012 10:14:09 +0000 (12:14 +0200)]
Add eat_token() for more clarity in the preprocessor.

11 years agorework preprocessor token number
Matthias Braun [Mon, 28 May 2012 15:44:21 +0000 (17:44 +0200)]
rework preprocessor token number

We now use the "normal" token numbers where possible, special preprocessor token
numbers are only used to disambiguate between directives. This change was also
necessary because preprocessing directive identifiers are not reserved keywords.