From 705d6a72e4586d6bd46f40fbaff0b5099c805162 Mon Sep 17 00:00:00 2001 From: johnvg Date: Tue, 6 Sep 2011 12:16:33 +0000 Subject: add BEExtendableAlgebraicType git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1971 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d --- backendC/CleanCompilerSources/backend.c | 20 ++++++++++++++++++++ backendC/CleanCompilerSources/backend.h | 3 +++ 2 files changed, 23 insertions(+) (limited to 'backendC/CleanCompilerSources') 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) -- cgit v1.2.3