| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| | |
[declaration_specifiers_no_type?].
Inlining these options was not necessary.
This reduces the number of states in the automaton.
|
| | |
|
| | |
|
| |
| |
| |
| | |
This leads to a smaller automaton.
|
| |
| |
| |
| |
| |
| | |
declarators and FOR loops.
This leads to fewer automaton states, and potentially better error messages.
|
| |
| |
| |
| |
| |
| |
| | |
This leads to a small savings in the number of states (which could
become greater in the future if we decide to parameterize expressions).
If desired, the old automaton could be recovered by marking the binary
operators as %inline.
|
| |
| |
| |
| | |
This is analogous to the previous commit.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
[struct_or_union_specifier].
The old version was strictly equivalent to using [ioption(other_identifier)].
The new version uses [option(other_identifier)] instead, that is, [other_identifier?].
Technically, this means that [set_id_type i OtherId] is called slightly earlier (at
the opening brace, instead of at the closing brace), but this does not make any
difference, since the re-classification of identifiers affects only the second
parsing phase.
|
| |
| |
| |
| |
| |
| |
| | |
A TYPEDEF_NAME is already classified as a [TypedefId] by the lexer,
and similarly, a VAR_NAME is already classified as a [VarId].
Thus, the removed calls had no effect.
The remaining calls to [set_id_type] are useful, as they can re-classify a token.
|
| |
| |
| |
| |
| |
| | |
i OtherId].
This causes no change in the automaton.
|
| |
| |
| |
| | |
I missed this opportunity in the previous commit.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The existing [option(X)] was marked %inline, and has been renamed [ioption(X)].
A new [option(X)], which is not marked %inline, has been introduced.
The grammar now uses [option] everywhere, except where [ioption] is necessary
in order to avoid conflicts.
This reduces the number of states in the automaton. The number of LR(0) cores
drops from 857 to 712.
|
|/
|
|
| |
This violates the 80-column width limit, but is really important.
|
|
|
|
| |
handled as a function with void parameter.
|
|
|
|
|
| |
C11 allows a typedef redefinition if the types are the same.
We now allow this also and issue a warning and an error if the types are different.
|
|\
| |
| | |
Correction of a few bugs in the pre-parser, added comments.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
was not parsed correctly:
typedef int a;
int f() {
for(int a; ;)
if(1);
a * x;
}
Additionnaly, I tried to add some comments in the pre-parser code,
especially for the different hacks used to solve various conflicts.
|
| | |
|
| |
| |
| |
| |
| |
| | |
Local variables are now added with bogus lexical scopes to reflect
the actually lexical scopes. Also this commit fixes assembler problems
of the das when a user section with the name ".text" is defined.
|
|\ \
| | |
| | |
| | |
| | | |
Conflicts:
cparser/Unblock.ml
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As observed by B. Schommer, it is not enough to track scopes for every source line, as blocks can occur on a single line (think macros). Hence:
- Revert debug annotations of kind 1 to contain only line number info.
Generate them only when the line number changes.
- Use debug annotations of kind 6 to record the list of active scopes
(as BA_int integer arguments to __builtin_annot). Generate them
before every nontrivial statement, even if on the same line as others.
- Remove the generation of "variable x is declared in scope N" debug
annotations. This can be tracked separately and more efficiently.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Instead of creating separate annotations for the local variables
we call the Debug.add_lvar_scope and we construct a mapping from
function id + scope id to scope information.
|
|\| |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
debug/CtoDwarf.ml
debug/DwarfPrinter.ml
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
C2C: the code that insert debug builtins with the line numbers is now
in Unblock. Handle calls to __builtin_debug.
Unblock: generate __builtin_debug(1) for line numbers, carrying
the list of active scopes as extra arguments.
Generate __builtin_debug(6) for local variable declarations,
carrying the corresponding scope number as extra argument.
Constprop: avoid duplicating debug arguments that are constants already.
PrintAsmaux: show this extra debug info as comments.
|
| |
| |
| |
| |
| | |
The transformation is the same as the one used for structs but packing
always stops after each member.
|
| |
| |
| |
| |
| | |
If they only report an error an assertion failure in Reame.ml was
triggered.
|
| |
| |
| |
| |
| | |
Instead of reimplementing the whole scope handling in the debug information
use the existing functionality and fill the scopes explicitly in the functions.
|
| |
| |
| |
| |
| |
| | |
Scopes will be handled by a stack of all open scopes. This stack
then can also be used to generate the debug directives to track the
scopes through the rest of the passes.
|
| |
| |
| |
| |
| | |
Introduced a new dwarf generation from the information collected in
the DebugInformation and removed the old CtODwarf translation.
|
|/
|
|
|
|
| |
Added functions to add more information to the debuging interface,
like the struct layout with offsets, bitifiled layout and removed
the no longer needed mapping from stamp to atom.
|
|
|
|
| |
structured builtin arguments and results.
|
|
|
|
| |
static variables to avoid problems with files such as "a b.c".
|
| |
|
|
|
|
| |
parameter.
|
| |
|
|
|
|
|
|
| |
The copy optimization is not correct in case of overlap between destination
and source. We would need to use an hypothetical __builtin_memmove_aligned
that can cope with overlap to implement the copy at return of callee.
|
|
|
|
|
|
|
|
| |
As per ISO C99, "hosted environment".
"return 0" is added at the end of any function named "main" that has
"int" as return type. If the name is "main" but the return type is
not "int", emit a warning and do not add anything.
|
|
|
|
| |
Also: improve error message by showing old and new types.
|
|
|
|
|
|
| |
cparser/Bitfields.ml: when assigning to a bit field of type _Bool, the
right-hand side must be normalized to 0 or 1 via a cast to _Bool.
test/regression/bitfields{1,9}.c: add corresponding test cases.
|
|\ |
|
| | |
|
|/ |
|
|\
| |
| |
| |
| | |
Conflicts:
driver/Driver.ml
|
| | |
|
|\| |
|
| |
| |
| |
| |
| | |
Otherwise we get too many errors on glibc's standard headers.
A real error will occur when the anonymous struct/union is accessed.
|
| |
| |
| |
| | |
variable is redefined as a typedef.
|
|/ |
|
| |
|
|
|
|
| |
non-static declaration is followed by a static declaration/definition.
|