Commit graph

27 commits

Author SHA1 Message Date
Cédric Pasteur 1c43a8b1ac Fixed code generation for constant arrays 2011-09-14 09:08:28 +02:00
Cédric Pasteur c550b09805 Fixed code generated for alias types to arrays 2011-09-09 13:54:29 +02:00
Cédric Pasteur 53043b403c Small fixes in the C backend 2011-09-07 13:24:33 +02:00
Cédric Pasteur 2147402a20 Const should be declared static
Otherwise the C compiler complains about multiple
definitions of the same symbol
2011-09-06 14:31:14 +02:00
Cédric Pasteur 4cd506f3db Added c ast for constant
Also print only short names for struct fields
2011-09-06 14:20:57 +02:00
Cédric Pasteur 7d95b95ed7 Merge branch 'memalloc' into decade
Conflicts:
	compiler/global/signature.ml
	compiler/heptagon/analysis/typing.ml
	compiler/heptagon/hept_printer.ml
	compiler/heptagon/hept_utils.ml
	compiler/heptagon/heptagon.ml
	compiler/heptagon/parsing/hept_parser.mly
	compiler/heptagon/parsing/hept_parsetree.ml
	compiler/heptagon/parsing/hept_scoping.ml
	compiler/heptagon/transformations/switch.ml
	compiler/main/hept2mls.ml
	compiler/minils/minils.ml
	compiler/minils/mls_printer.ml
	compiler/obc/c/cgen.ml
	compiler/obc/control.ml
	compiler/utilities/misc.mli
2011-07-21 08:50:45 +02:00
Adrien Guatto 4794045208 Reworked Obc AST: from right patterns to extvalues.
I introduced a notion of extended values in Obc expressions,
replacing the Epattern constructor. Patterns may now only
occur at their rightful place, on the left of an assignment.

This change allows to index global constant arrays.
2011-05-30 16:25:00 +02:00
Cédric Pasteur 96054a67b6 Correct order for indices in array declaration
In C, the order in the declaration of variables
is the same as for access
2011-05-24 11:16:27 +02:00
Cédric Pasteur c6aa63b444 Heptc compiles again
AFor now expects expressions instead of static exps
2011-04-18 15:38:42 +02:00
Cédric Pasteur 35775c4131 C backend ported to recent API changes in Obc 2011-03-09 09:46:00 +01:00
Léonard Gérard cab8bb706e backport from async. 2011-03-09 00:06:36 +01:00
Léonard Gérard 8f4411e145 Recursives Qualnames.
In order to have a correct handling of inner classes in Java, and to prepare for modules inside modules.
2011-02-07 14:24:17 +01:00
Léonard Gérard df469db394 New Java backend closing 2011-01-24 16:09:28 +01:00
Léonard Gérard 7b4f34a521 Cgen only stdbool.h booleans no more TRUE and FALSE. 2010-11-04 18:06:11 +01:00
Cédric Pasteur df12e081ae Refactored Misc
Created two new files: 
 - utilities/global/compiler_options.ml: contains
 the options that can be set using the cli
 - utilities/global/errors.ml: contains global
 errors definition

Misc now only contains helper functions that have 
nothing to do with the ast or the compiler.
2010-09-15 09:38:52 +02:00
Léonard Gérard 02db2ad6b4 Changed compile flags, and cleaned a bit.
Warn as error for partial match.
Warn for unused variables : added some TODO to check.
PS : I'll deal with callgraph which is doing things that Modules does.
2010-09-14 09:39:02 +02:00
Cédric Pasteur 5aa83246ca Use qualnames for types and fields in C
We need qualnames because we try to find types and
fields in the environment during the generation of
the code.
2010-09-13 15:20:25 +02:00
Cédric Pasteur 50223653a4 Do not forget to flush the output
The end of some header files was not printed.
2010-09-13 15:20:17 +02:00
Cédric Pasteur 2956e6feb4 Fix printing of arrays in C code
It should be 
  f(int a[5])
instead of 
  f(int *a)
because the second one does not scale for 
multidimensional arrays, eg
  g(int b[10][5]) is ok
but
  g(int **b) is not.
2010-09-03 15:27:58 +02:00
Léonard Gérard 5c09abeb18 Revet last commit a5f89876c2 and gives the right fix.
Plus remove all the forbidden '\n', replaced with '@.' or '@\n' depending on context.
2010-09-01 14:40:31 +02:00
Léonard Gérard 9df4f625a2 Fixed location to use formatter instead of out_channel. 2010-08-24 17:29:00 +02:00
Cédric Pasteur 02dd7fa124 Added alias for types (aka typedef)
For instance:
type metres = int
type metres = MyLib.longueur
type matrice = metres^10^100

Code generation in C (with typedef) included. The 
code uses the aliases for traceability.
2010-07-27 09:23:16 +02:00
Adrien Guatto 9301ed0b09 Fixes for correct array literal C generation. 2010-07-19 15:16:14 +02:00
Cédric Pasteur b6583f22b6 Complete fix for the identifiers problem 2010-07-16 14:09:37 +02:00
Cédric Pasteur d42e56203b Fix for identifiers in C
Instead of calling cname_of_name before creating 
the C ast, keep original names and convert them
when pretty printing the code.
2010-07-16 13:48:37 +02:00
Cédric Pasteur cdc9b14a44 Fixed problem with multidimensional arrays in args 2010-07-16 12:38:45 +02:00
Cédric Pasteur cee9eed24a Moved sequential/ to obc/ 2010-07-08 15:20:25 +02:00
Renamed from compiler/sequential/c/c.ml (Browse further)