aboutsummaryrefslogtreecommitdiff
path: root/backendC/CleanCompilerSources
diff options
context:
space:
mode:
Diffstat (limited to 'backendC/CleanCompilerSources')
-rw-r--r--backendC/CleanCompilerSources/backend.c66
-rw-r--r--backendC/CleanCompilerSources/backend.h36
-rw-r--r--backendC/CleanCompilerSources/typeconv_2.c18
3 files changed, 111 insertions, 9 deletions
diff --git a/backendC/CleanCompilerSources/backend.c b/backendC/CleanCompilerSources/backend.c
index 726cfd6..49eedca 100644
--- a/backendC/CleanCompilerSources/backend.c
+++ b/backendC/CleanCompilerSources/backend.c
@@ -18,6 +18,8 @@
# include "comsupport.h" /* CurrentModule */
# include "buildtree.h" /* TupleSymbol, ApplySymbol */
+extern void InitARC_Info (void); /* from typeconv.h */
+
# include "backendsupport.h"
# define Clean(ignore)
@@ -1155,6 +1157,7 @@ BENormalTypeNode (BESymbolP symbol, BETypeArgP args)
return (node);
} /* BENormalTypeNode */
+
BETypeNodeP
BEAttributeTypeNode (BEAttribution attribution, BETypeNodeP typeNode)
{
@@ -1164,6 +1167,63 @@ BEAttributeTypeNode (BEAttribution attribution, BETypeNodeP typeNode)
return (typeNode);
} /* BEAttributeTypeNode */
+BEAttributeKindList
+BEAttributeKind (BEAttribution attributeKind)
+{
+ AttributeKindList new;
+
+ new = ConvertAllocType (struct attr_kind_list);
+
+ new->akl_elem = attributeKind;
+ new->akl_next = NULL;
+
+ return (new);
+} /* BEAttributeKind */
+
+BEAttributeKindList
+BENoAttributeKinds (void)
+{
+ return (NULL);
+} /* BENoAttributeKinds */
+
+BEAttributeKindList
+BEAttributeKinds (BEAttributeKindList elem, BEAttributeKindList list)
+{
+ Assert (elem->akl_next == NULL);
+ elem->akl_next = list;
+
+ return (elem);
+} /* BEAttributeKindList */
+
+BEUniVarEquations
+BEUniVarEquation (BEAttribution demanded, BEAttributeKindList offered)
+{
+ UniVarEquations new;
+
+ new = ConvertAllocType (struct uni_var_equats);
+
+ new->uve_demanded = demanded;
+ new->uve_offered = offered;
+ new->uve_next = NULL;
+
+ return (new);
+} /* BEUniVarEquation */
+
+BEUniVarEquations
+BENoUniVarEquations (void)
+{
+ return (NULL);
+} /* BENoUniVarEquations */
+
+BEUniVarEquations
+BEUniVarEquationsList (BEUniVarEquations elem, BEUniVarEquations list)
+{
+ Assert (elem->uve_next == NULL);
+ elem->uve_next = list;
+
+ return (elem);
+} /* BEUniVarEquations */
+
BETypeNodeP
BEAnnotateTypeNode (BEAnnotation annotation, BETypeNodeP typeNode)
{
@@ -1193,7 +1253,7 @@ BETypeArgs (BETypeNodeP node, BETypeArgP nextArgs)
} /* BETypeArgs */
BETypeAltP
-BETypeAlt (BETypeNodeP lhs, BETypeNodeP rhs)
+BETypeAlt (BETypeNodeP lhs, BETypeNodeP rhs, BEUniVarEquations attributeEquations)
{
TypeAlt *alt;
@@ -1203,7 +1263,7 @@ BETypeAlt (BETypeNodeP lhs, BETypeNodeP rhs)
alt->type_alt_rhs = rhs;
alt->type_alt_type_context = NULL; /* used in PrintType */
- alt->type_alt_attr_equations = NULL; /* used in PrintType */
+ alt->type_alt_attr_equations = attributeEquations; /* used in PrintType */
return (alt);
} /* BETypeAlt */
@@ -2380,6 +2440,7 @@ BETypeVar (CleanString name)
ident->ident_tv = typeVar;
typeVar->tv_ident = ident;
+ typeVar->tv_mark = 0;
typeVar->tv_argument_nr = 0; /* ??? */
return (typeVar);
@@ -3200,6 +3261,7 @@ BEInit (int argc)
ClearOpenDefinitionModules ();
+ InitARC_Info ();
InitStatesGen ();
InitCoding ();
InitInstructions ();
diff --git a/backendC/CleanCompilerSources/backend.h b/backendC/CleanCompilerSources/backend.h
index 2198250..c36245c 100644
--- a/backendC/CleanCompilerSources/backend.h
+++ b/backendC/CleanCompilerSources/backend.h
@@ -1,15 +1,15 @@
/* version info */
// increment this for every release
-# define kBEVersionCurrent 0x02000209
+# define kBEVersionCurrent 0x02000210
// change this to the same value as kBEVersionCurrent if the new release is not
// upward compatible (for example when a function is added)
-# define kBEVersionOldestDefinition 0x02000204
+# define kBEVersionOldestDefinition 0x02000210
// change this to the same value as kBEVersionCurrent if the new release is not
// downward compatible (for example when a function is removed)
-# define kBEVersionOldestImplementation 0x02000209
+# define kBEVersionOldestImplementation 0x02000210
# define kBEDebug 1
@@ -88,7 +88,13 @@ Clean (:: BENodeIdListP :== CPtr)
typedef struct node_id_ref_count_list *BENodeIdRefCountListP;
Clean (:: BENodeIdRefCountListP :== CPtr)
-
+
+typedef struct uni_var_equats *BEUniVarEquations;
+Clean (:: BEUniVarEquations :== CPtr)
+
+typedef struct attr_kind_list *BEAttributeKindList;
+Clean (:: BEAttributeKindList :== CPtr)
+
/* constants */
/*
# define kIclModuleIndex 0
@@ -238,14 +244,32 @@ Clean (BEAnnotateTypeNode :: BEAnnotation BETypeNodeP BackEnd -> (BETypeNodeP, B
BETypeNodeP BEAttributeTypeNode (BEAttribution attribution, BETypeNodeP typeNode);
Clean (BEAttributeTypeNode :: BEAttribution BETypeNodeP BackEnd -> (BETypeNodeP, BackEnd))
+BEAttributeKindList BEAttributeKind (BEAttribution attributeKind);
+Clean (BEAttributeKind :: BEAttribution BackEnd -> (BEAttributeKindList, BackEnd))
+
+BEAttributeKindList BENoAttributeKinds (void);
+Clean (BENoAttributeKinds :: BackEnd -> (BEAttributeKindList, BackEnd))
+
+BEAttributeKindList BEAttributeKinds (BEAttributeKindList elem, BEAttributeKindList list);
+Clean (BEAttributeKinds :: BEAttributeKindList BEAttributeKindList BackEnd -> (BEAttributeKindList, BackEnd))
+
+BEUniVarEquations BEUniVarEquation (BEAttribution demanded, BEAttributeKindList offered);
+Clean (BEUniVarEquation ::BEAttribution BEAttributeKindList BackEnd -> (BEUniVarEquations, BackEnd))
+
+BEUniVarEquations BENoUniVarEquations (void);
+Clean (BENoUniVarEquations :: BackEnd -> (BEUniVarEquations, BackEnd))
+
+BEUniVarEquations BEUniVarEquationsList (BEUniVarEquations elem, BEUniVarEquations list);
+Clean (BEUniVarEquationsList ::BEUniVarEquations BEUniVarEquations BackEnd -> (BEUniVarEquations, BackEnd))
+
BETypeArgP BENoTypeArgs (void);
Clean (BENoTypeArgs :: BackEnd -> (BETypeArgP, BackEnd))
BETypeArgP BETypeArgs (BETypeNodeP node, BETypeArgP nextArgs);
Clean (BETypeArgs :: BETypeNodeP BETypeArgP BackEnd -> (BETypeArgP, BackEnd))
-BETypeAltP BETypeAlt (BETypeNodeP lhs, BETypeNodeP rhs);
-Clean (BETypeAlt :: BETypeNodeP BETypeNodeP BackEnd -> (BETypeAltP, BackEnd))
+BETypeAltP BETypeAlt (BETypeNodeP lhs, BETypeNodeP rhs, BEUniVarEquations attributeEquations);
+Clean (BETypeAlt :: BETypeNodeP BETypeNodeP BEUniVarEquations BackEnd -> (BETypeAltP, BackEnd))
BENodeP BENormalNode (BESymbolP symbol, BEArgP args);
Clean (BENormalNode :: BESymbolP BEArgP BackEnd -> (BENodeP, BackEnd))
diff --git a/backendC/CleanCompilerSources/typeconv_2.c b/backendC/CleanCompilerSources/typeconv_2.c
index 7f828f7..f4a82be 100644
--- a/backendC/CleanCompilerSources/typeconv_2.c
+++ b/backendC/CleanCompilerSources/typeconv_2.c
@@ -308,7 +308,7 @@ static Bool PrintAttribute (AttributeKind attr, Bool print_colon)
else if (DoShowAttributes)
{ Bool used_implicitly;
unsigned attr_nr = RetrieveRefCountInfo (attr - FirstUniVarNumber, & used_implicitly);
-
+
if (attr_nr == 0)
{ if (! used_implicitly)
{ FPutC ('.', StdListTypes);
@@ -559,6 +559,7 @@ static void PrintAttributeEquations (UniVarEquations attr_equas)
for (next = attr_equas -> uve_offered ; ; )
{ unsigned off_attr_nr = RetrieveRefCountInfo (next -> akl_elem - FirstUniVarNumber, & used_implicitly);
+
PrintAttributeVariable (off_attr_nr);
if ((next = next -> akl_next))
FPutC (' ', StdListTypes);
@@ -666,3 +667,18 @@ void PrintType (SymbDef tdef, TypeAlts type)
} /* PrintType */
+
+/******
+
+ Routines for printing types
+
+******/
+
+
+void InitARC_Info (void)
+{
+ CurrentARC_Info = CompAllocType (struct attr_ref_count_info);
+ CurrentARC_Info -> arci_next = NULL;
+
+} /* InitARC_Info */
+