diff options
author | johnvg | 2011-09-06 12:16:33 +0000 |
---|---|---|
committer | johnvg | 2011-09-06 12:16:33 +0000 |
commit | 705d6a72e4586d6bd46f40fbaff0b5099c805162 (patch) | |
tree | f1ecd0143b6a855da5fc13131be801aa01ad60e5 /backendC/CleanCompilerSources | |
parent | remove unused function getGenericDef (diff) |
add BEExtendableAlgebraicType
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1971 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'backendC/CleanCompilerSources')
-rw-r--r-- | backendC/CleanCompilerSources/backend.c | 20 | ||||
-rw-r--r-- | backendC/CleanCompilerSources/backend.h | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/backendC/CleanCompilerSources/backend.c b/backendC/CleanCompilerSources/backend.c index 4f149f4..b01274a 100644 --- a/backendC/CleanCompilerSources/backend.c +++ b/backendC/CleanCompilerSources/backend.c @@ -2854,6 +2854,26 @@ BEAlgebraicType (BEFlatTypeP lhs, BEConstructorListP constructors) sdef->sdef_type = type; } /* BEAlgebraicType */ +void BEExtendableAlgebraicType (BEFlatTypeP lhs, BEConstructorListP constructors) +{ + Types type; + SymbDefP sdef; + + type = ConvertAllocType (struct type); + type->type_next = NULL; + type->type_lhs = lhs; + type->type_line = 0; + type->type_constructors = constructors; + type->type_nr_of_constructors = 0; + + for (; constructors!=NULL; constructors=constructors->cl_next) + constructors->cl_constructor->type_node_symbol->symb_def->sdef_type = type; + + sdef = type->type_lhs->ft_symbol->symb_def; + sdef->sdef_kind = TYPE; + sdef->sdef_type = type; +} + void BERecordType (int moduleIndex, BEFlatTypeP lhs, BETypeNodeP constructorType, int is_boxed_record, BEFieldListP fields) { diff --git a/backendC/CleanCompilerSources/backend.h b/backendC/CleanCompilerSources/backend.h index 4a17ac6..26e1a67 100644 --- a/backendC/CleanCompilerSources/backend.h +++ b/backendC/CleanCompilerSources/backend.h @@ -442,6 +442,9 @@ Clean (BEFlatType :: BESymbolP BEAttribution BETypeVarListP BackEnd -> (BEFlatTy void BEAlgebraicType (BEFlatTypeP lhs, BEConstructorListP constructors); Clean (BEAlgebraicType:: BEFlatTypeP BEConstructorListP BackEnd -> BackEnd) +void BEExtendableAlgebraicType (BEFlatTypeP lhs, BEConstructorListP constructors); +Clean (BEExtendableAlgebraicType:: BEFlatTypeP BEConstructorListP BackEnd -> BackEnd) + void BERecordType (int moduleIndex, BEFlatTypeP lhs, BETypeNodeP constructorType, int is_boxed_record, BEFieldListP fields); Clean (BERecordType :: Int BEFlatTypeP BETypeNodeP Int BEFieldListP BackEnd -> BackEnd) |