aboutsummaryrefslogtreecommitdiff
path: root/backendC
diff options
context:
space:
mode:
authorjohnvg2011-09-06 12:16:33 +0000
committerjohnvg2011-09-06 12:16:33 +0000
commit705d6a72e4586d6bd46f40fbaff0b5099c805162 (patch)
treef1ecd0143b6a855da5fc13131be801aa01ad60e5 /backendC
parentremove 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')
-rw-r--r--backendC/CleanCompilerSources/backend.c20
-rw-r--r--backendC/CleanCompilerSources/backend.h3
-rw-r--r--backendC/backend.link1
-rw-r--r--backendC/backend.link641
4 files changed, 25 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)
diff --git a/backendC/backend.link b/backendC/backend.link
index 865b07e..d101391 100644
--- a/backendC/backend.link
+++ b/backendC/backend.link
@@ -86,6 +86,7 @@
/EXPORT: BENoTypes
/EXPORT: BEFlatType
/EXPORT: BEAlgebraicType
+/EXPORT: BEExtendableAlgebraicType
/EXPORT: BERecordType
/EXPORT: BEAbsType
/EXPORT: BEConstructors
diff --git a/backendC/backend.link64 b/backendC/backend.link64
index 61df576..f62e5c9 100644
--- a/backendC/backend.link64
+++ b/backendC/backend.link64
@@ -84,6 +84,7 @@
/EXPORT:BENoTypes
/EXPORT:BEFlatType
/EXPORT:BEAlgebraicType
+/EXPORT:BEExtendableAlgebraicType
/EXPORT:BERecordType
/EXPORT:BEAbsType
/EXPORT:BEConstructors