virtualization-lms-core icon indicating copy to clipboard operation
virtualization-lms-core copied to clipboard

Scala class generation for records

Open julienrf opened this issue 13 years ago • 1 comments

Hi,

I faced another problem with Scala code generation of records: the current implementation registers that a record type should be mapped to a case class only if the program to generate creates such a record (by using new Record { … }). If a program only uses a record its type isn’t be remapped to the corresponding case class. Furthermore, as the code generator relies on a mutable state, the mapping to a case class works only if a record is used after a record of the same type has been created, in a program.

I solved this problem in this branch but my solution is not satisfying either. It still relies on a mutable state but registers record types both on usage and creation. It uses only the RefinedManifest of the type of the record to generate the corresponding case class (so it can’t be transformed by the mirror process, as it is the case in the delite-develop branch). Furthermore, the hashing function I use to generate case class names according to the record type is not deterministic, so tests fail.

julienrf avatar Sep 11 '12 13:09 julienrf

yeah, i think we can't rely on uses happening after creation.

TiarkRompf avatar Sep 26 '12 16:09 TiarkRompf