aboutsummaryrefslogtreecommitdiffstats
path: root/cparser
Commit message (Collapse)AuthorAgeFilesLines
* Handle the special case of a typedef to void funciton parameter to beBernhard Schommer2015-10-051-2/+2
| | | | handled as a function with void parameter.
* Allow redefinition of a typedef with the same name.Bernhard Schommer2015-10-043-7/+53
| | | | | 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.
* Merge pull request #57 from jhjourdan/parser_fixBernhard Schommer2015-10-015-160/+297
|\ | | | | Correction of a few bugs in the pre-parser, added comments.
| * Fixed a few bugs in the pre parser. In particular, the following codeJacques-Henri Jourdan2015-09-305-160/+297
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Remove unused globals also from the debug informations.Bernhard Schommer2015-10-011-1/+6
| |
* | Added support for printing local variables and fixed issue with .textBernhard Schommer2015-09-231-0/+1
| | | | | | | | | | | | 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.
* | Merge branch 'debugscopes' into debug_locationsBernhard Schommer2015-09-231-33/+37
|\ \ | | | | | | | | | | | | Conflicts: cparser/Unblock.ml
| * | Continuing experiment: track the scopes of local variables via __builtin_debugXavier Leroy2015-09-211-34/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Record the scope structure during unblocking.Bernhard Schommer2015-09-224-11/+18
| | | | | | | | | | | | | | | | | | 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.
* | | Merge branch 'debugscopes' into debug_locationsBernhard Schommer2015-09-213-39/+175
|\| | | | | | | | | | | | | | | | | Conflicts: debug/CtoDwarf.ml debug/DwarfPrinter.ml
| * | Experiment: track the scopes of local variables via __builtin_debug.Xavier Leroy2015-09-201-32/+132
| |/ | | | | | | | | | | | | | | | | | | | | 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.
| * Added support for bitfields in unions.Bernhard Schommer2015-09-171-6/+42
| | | | | | | | | | The transformation is the same as the one used for structs but packing always stops after each member.
| * Global register variables result in fatal error.Bernhard Schommer2015-09-081-1/+1
| | | | | | | | | | If they only report an error an assertion failure in Reame.ml was triggered.
* | New version of adding scopes etc.Bernhard Schommer2015-09-201-1/+1
| | | | | | | | | | Instead of reimplementing the whole scope handling in the debug information use the existing functionality and fill the scopes explicitly in the functions.
* | Started implementing the scope for the Debug Informations.Bernhard Schommer2015-09-181-1/+3
| | | | | | | | | | | | 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.
* | First version with computation of dwarf info from debug info.Bernhard Schommer2015-09-172-4/+4
| | | | | | | | | | Introduced a new dwarf generation from the information collected in the DebugInformation and removed the old CtODwarf translation.
* | Move more functionality in the new interface.Bernhard Schommer2015-09-166-24/+43
|/ | | | | | 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.
* Simplify the handling of extended inline asm, taking advantage of the new, ↵Xavier Leroy2015-08-211-6/+5
| | | | structured builtin arguments and results.
* Remove non digit and non letter chars from filename used in renaming of ↵Bernhard Schommer2015-07-151-0/+1
| | | | static variables to avoid problems with files such as "a b.c".
* Reject incomplete types as return type.Bernhard Schommer2015-07-141-1/+4
|
* Use env1 instead of env to also have the type specifiers used in the return ↵Bernhard Schommer2015-07-091-1/+1
| | | | parameter.
* Propagated the composed type constructed build during identifier lookup.Bernhard Schommer2015-07-091-6/+6
|
* Turn off copy optimization when returning a composite by reference.Xavier Leroy2015-07-081-4/+10
| | | | | | 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.
* Add implicit "return 0;" at end of function "main".Xavier Leroy2015-07-081-1/+13
| | | | | | | | 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.
* Turn "redefinition with an incompatible type" warning into an error.Xavier Leroy2015-07-081-1/+6
| | | | Also: improve error message by showing old and new types.
* Fix issue with bit fields of type _BoolXavier Leroy2015-07-081-6/+22
| | | | | | 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.
* Merge github.com:AbsInt/CompCertBernhard Schommer2015-07-071-2/+5
|\
| * Change the definition of Typles.tupleJacques-Henri Jourdan2015-07-071-2/+5
| |
* | Diab defines w_char to be unsigned short.Bernhard Schommer2015-07-073-1/+7
|/
* Merge branch 'master' into json_exportBernhard Schommer2015-07-061-0/+1
|\ | | | | | | | | Conflicts: driver/Driver.ml
| * Simple fix for problem with local extern.Bernhard Schommer2015-06-241-0/+1
| |
* | Merge branch 'master' into json_exportBernhard Schommer2015-06-171-3/+9
|\|
| * Turn the error on anonymous structs/unions into a warning.Xavier Leroy2015-06-111-1/+1
| | | | | | | | | | Otherwise we get too many errors on glibc's standard headers. A real error will occur when the anonymous struct/union is accessed.
| * Error if, in the same scope, a typedef is redefined as a variable, or a ↵Xavier Leroy2015-06-061-2/+8
| | | | | | | | variable is redefined as a typedef.
* | Added flag for the renaming of static functions.Bernhard Schommer2015-05-193-8/+24
|/
* Make a register as storage specify to a fatal error.Bernhard Schommer2015-05-141-1/+1
|
* Changed the enter_or_refine_ident function to produce an error if a ↵Bernhard Schommer2015-05-131-6/+14
| | | | non-static declaration is followed by a static declaration/definition.
* Extended inline asm: revised treatment of clobbered registers.Xavier Leroy2015-05-091-3/+4
| | | | | | | | | | - Treat clobbered registers as being destroyed by EF_inline_asm builtins (which is the truth, semantically). - To enable the above, represent clobbers as Coq strings rather than idents and move register_by_name from Machregsaux.ml to Machregs.v. - Side benefit: more efficient implementation of Machregsaux.name_of_register. -# Please enter the commit message for your changes. Lines starting
* Detect uses of anonymous structs/unions (a C2011 feature and GCC extension) ↵Xavier Leroy2015-04-301-0/+14
| | | | and produce a diagnostic instead of ignoring them.
* Detect and reject "&" operator applied to "register" local variable or to a ↵Xavier Leroy2015-04-283-0/+34
| | | | bit field.
* Bitfield improvements continued: perform bitfield expansion before ↵Xavier Leroy2015-04-282-180/+210
| | | | unblocking; improve translation of bitfield initializers and compound literals.
* Extended inline asm: handle missing cases.Xavier Leroy2015-04-286-19/+46
| | | | | | Bitfields: better translation of initializers and compound literals; run this pass before unblocking. Transform.stmt: extend with ability to treat unblocked code. test/regression: more bitfield tests.
* Allow "scratch" (non-allocatable temporary registers) to be mentioned in asm ↵Xavier Leroy2015-04-231-0/+1
| | | | clobber lists.
* Extended asm: more lenient treatment of constraints.Xavier Leroy2015-04-221-10/+21
| | | | | We can ignore alternatives as long as one of the constraints we handle (r, m, i, n) is there.
* Avoid multiple errors being reported in the case #outputs >= 2.Xavier Leroy2015-04-211-2/+6
|
* Proper treatment of extended asm.Xavier Leroy2015-04-211-1/+5
|
* Support for GCC-style extended asm, continued:Xavier Leroy2015-04-211-0/+183
| | | | | | | | - support "r", "m" and "i" constraints - support "%Q" and "%R" modifiers for register pairs - support register clobbers - split off analysis and transformation of asm statements in cparser/ExtendedAsm.ml
* Experiment: support a subset of GCC's extended asm statements.Xavier Leroy2015-04-178-21/+168
|
* Merge branch 'master' into dwarfBernhard Schommer2015-04-141-0/+7
|\
| * Detect (and reject with an error) preprocessing numbers that are not valid ↵Xavier Leroy2015-04-061-0/+7
| | | | | | | | integer or floating constants.