Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-compiler-and-rts
compiler
Commits
ea2996f7
Commit
ea2996f7
authored
Jun 17, 2003
by
Ronny Wichers Schreur
🏢
Browse files
removed unused functions
updated version (necessary because previous commit introduced incompatibilities)
parent
e2d66af3
Changes
2
Hide whitespace changes
Inline
Side-by-side
backendC/CleanCompilerSources/backend.c
View file @
ea2996f7
...
...
@@ -2733,7 +2733,7 @@ BENoTypeVars (void)
}
/* BENoTypeVars */
BEFlatTypeP
BEFlatType
X
(
BESymbolP
symbol
,
BEAttribution
attribution
,
BETypeVarListP
arguments
)
BEFlatType
(
BESymbolP
symbol
,
BETypeVarListP
arguments
)
{
FlatType
flatType
;
int
i
;
...
...
@@ -2749,15 +2749,9 @@ BEFlatTypeX (BESymbolP symbol, BEAttribution attribution, BETypeVarListP argumen
flatType
->
ft_cons_vars
=
NULL
;
/* used in PrintType */
flatType
->
ft_attribute
=
(
AttributeKind
)
attribution
;
;
flatType
->
ft_attribute
=
NoUniAttr
;
return
(
flatType
);
}
/* BEFlatTypeX */
BEFlatTypeP
BEFlatType
(
BESymbolP
symbol
,
BETypeVarListP
arguments
)
{
return
BEFlatTypeX
(
symbol
,
NoUniAttr
,
arguments
);
}
/* BEFlatType */
void
...
...
@@ -2802,7 +2796,7 @@ BEAlgebraicType (BEFlatTypeP lhs, BEConstructorListP constructors)
}
/* BEAlgebraicType */
void
BERecordType
X
(
int
moduleIndex
,
BEFlatTypeP
lhs
,
BETypeNodeP
constructorType
,
int
is_boxed_record
,
BEFieldListP
fields
)
BERecordType
(
int
moduleIndex
,
BEFlatTypeP
lhs
,
BETypeNodeP
constructorType
,
BEFieldListP
fields
)
{
int
nFields
;
Types
type
;
...
...
@@ -2849,7 +2843,7 @@ BERecordTypeX (int moduleIndex, BEFlatTypeP lhs, BETypeNodeP constructorType, in
sdef
->
sdef_type
=
type
;
sdef
->
sdef_arity
=
constructorType
->
type_node_arity
;
sdef
->
sdef_boxed_record
=
is_boxed_record
;
sdef
->
sdef_boxed_record
=
FALSE
;
// +++ change this
{
...
...
@@ -2867,12 +2861,6 @@ BERecordTypeX (int moduleIndex, BEFlatTypeP lhs, BETypeNodeP constructorType, in
}
}
/* BERecordType */
void
BERecordType
(
int
moduleIndex
,
BEFlatTypeP
lhs
,
BETypeNodeP
constructorType
,
BEFieldListP
fields
)
{
BERecordTypeX
(
moduleIndex
,
lhs
,
constructorType
,
0
,
fields
);
}
void
BEAbsType
(
BEFlatTypeP
lhs
)
{
...
...
@@ -3301,7 +3289,7 @@ BEGenerateCode (CleanString outputFile)
}
/* BEGenerateCode */
void
BEExportType
(
int
dclTypeIndex
,
int
iclT
ypeIndex
)
BEExportType
(
int
isDictionary
,
int
t
ypeIndex
)
{
BEModuleP
dclModule
,
iclModule
;
SymbolP
typeSymbol
;
...
...
@@ -3309,8 +3297,8 @@ BEExportType (int dclTypeIndex, int iclTypeIndex)
iclModule
=
&
gBEState
.
be_modules
[
main_dcl_module_n
];
Assert
((
unsigned
int
)
iclT
ypeIndex
<
iclModule
->
bem_nTypes
);
typeSymbol
=
iclModule
->
bem_types
[
iclT
ypeIndex
];
Assert
((
unsigned
int
)
t
ypeIndex
<
iclModule
->
bem_nTypes
);
typeSymbol
=
iclModule
->
bem_types
[
t
ypeIndex
];
Assert
(
typeSymbol
->
symb_kind
==
definition
);
iclDef
=
typeSymbol
->
symb_def
;
...
...
@@ -3318,13 +3306,12 @@ BEExportType (int dclTypeIndex, int iclTypeIndex)
dclModule
=
&
gBEState
.
be_icl
.
beicl_dcl_module
;
/* +++ remove -1 hack */
if
(
dclTypeIndex
==
-
1
)
if
(
isDictionary
)
dclDef
=
iclDef
;
else
{
Assert
((
unsigned
int
)
dclT
ypeIndex
<
dclModule
->
bem_nTypes
);
typeSymbol
=
dclModule
->
bem_types
[
dclT
ypeIndex
];
Assert
((
unsigned
int
)
t
ypeIndex
<
dclModule
->
bem_nTypes
);
typeSymbol
=
dclModule
->
bem_types
[
t
ypeIndex
];
Assert
(
typeSymbol
->
symb_kind
==
definition
);
dclDef
=
typeSymbol
->
symb_def
;
}
...
...
@@ -3337,50 +3324,22 @@ BEExportType (int dclTypeIndex, int iclTypeIndex)
}
/* BEExportType */
void
BE
SwapTypes
(
int
frm
,
int
to
)
BE
ExportConstructor
(
int
constructorIndex
)
{
BEModuleP
module
;
SymbolP
save
;
module
=
&
gBEState
.
be_modules
[
main_dcl_module_n
];
Assert
((
unsigned
int
)
frm
<
module
->
bem_nTypes
);
Assert
((
unsigned
int
)
to
<
module
->
bem_nTypes
);
save
=
module
->
bem_types
[
frm
];
module
->
bem_types
[
frm
]
=
module
->
bem_types
[
to
];
module
->
bem_types
[
to
]
=
save
;
}
/* BESwapTypes */
void
BEExportConstructor
(
int
dclConstructorIndex
,
int
iclConstructorIndex
)
{
BEModuleP
dclModule
,
iclModule
;
BEModuleP
iclModule
;
SymbolP
constructorSymbol
;
SymbDefP
iclDef
,
dclDef
;
iclModule
=
&
gBEState
.
be_modules
[
main_dcl_module_n
];
Assert
((
unsigned
int
)
iclC
onstructorIndex
<
iclModule
->
bem_nConstructors
);
constructorSymbol
=
iclModule
->
bem_constructors
[
iclC
onstructorIndex
];
Assert
((
unsigned
int
)
c
onstructorIndex
<
iclModule
->
bem_nConstructors
);
constructorSymbol
=
iclModule
->
bem_constructors
[
c
onstructorIndex
];
Assert
(
constructorSymbol
->
symb_kind
==
definition
);
iclDef
=
constructorSymbol
->
symb_def
;
iclDef
->
sdef_exported
=
True
;
if
(
0
)
{
dclModule
=
&
gBEState
.
be_icl
.
beicl_dcl_module
;
Assert
((
unsigned
int
)
dclConstructorIndex
<
dclModule
->
bem_nConstructors
);
constructorSymbol
=
dclModule
->
bem_constructors
[
dclConstructorIndex
];
Assert
(
constructorSymbol
->
symb_kind
==
definition
);
dclDef
=
constructorSymbol
->
symb_def
;
Assert
(
strcmp
(
iclDef
->
sdef_ident
->
ident_name
,
dclDef
->
sdef_ident
->
ident_name
)
==
0
);
}
else
dclDef
=
iclDef
;
dclDef
=
iclDef
;
iclDef
->
sdef_dcl_icl
=
dclDef
;
dclDef
->
sdef_dcl_icl
=
iclDef
;
...
...
@@ -3389,7 +3348,7 @@ BEExportConstructor (int dclConstructorIndex, int iclConstructorIndex)
}
/* BEExportConstructor */
void
BEExportField
(
int
dclFieldIndex
,
int
iclF
ieldIndex
)
BEExportField
(
int
isDictionaryField
,
int
f
ieldIndex
)
{
BEModuleP
dclModule
,
iclModule
;
SymbolP
fieldSymbol
;
...
...
@@ -3397,22 +3356,21 @@ BEExportField (int dclFieldIndex, int iclFieldIndex)
iclModule
=
&
gBEState
.
be_modules
[
main_dcl_module_n
];
Assert
((
unsigned
int
)
iclF
ieldIndex
<
iclModule
->
bem_nFields
);
fieldSymbol
=
&
iclModule
->
bem_fields
[
iclF
ieldIndex
];
Assert
((
unsigned
int
)
f
ieldIndex
<
iclModule
->
bem_nFields
);
fieldSymbol
=
&
iclModule
->
bem_fields
[
f
ieldIndex
];
Assert
(
fieldSymbol
->
symb_kind
==
definition
);
iclDef
=
fieldSymbol
->
symb_def
;
iclDef
->
sdef_exported
=
True
;
/* +++ remove -1 hack */
if
(
dclFieldIndex
==
-
1
)
if
(
isDictionaryField
)
dclDef
=
iclDef
;
else
{
dclModule
=
&
gBEState
.
be_icl
.
beicl_dcl_module
;
Assert
((
unsigned
int
)
dclF
ieldIndex
<
dclModule
->
bem_nFields
);
fieldSymbol
=
&
dclModule
->
bem_fields
[
dclF
ieldIndex
];
Assert
((
unsigned
int
)
f
ieldIndex
<
dclModule
->
bem_nFields
);
fieldSymbol
=
&
dclModule
->
bem_fields
[
f
ieldIndex
];
Assert
(
fieldSymbol
->
symb_kind
==
definition
);
dclDef
=
fieldSymbol
->
symb_def
;
}
...
...
@@ -3426,7 +3384,7 @@ BEExportField (int dclFieldIndex, int iclFieldIndex)
}
/* BEExportField */
void
BEExportFunction
(
int
dclFunctionIndex
,
int
iclF
unctionIndex
)
BEExportFunction
(
int
f
unctionIndex
)
{
BEModuleP
dclModule
,
iclModule
;
SymbolP
functionSymbol
;
...
...
@@ -3434,8 +3392,8 @@ BEExportFunction (int dclFunctionIndex, int iclFunctionIndex)
iclModule
=
&
gBEState
.
be_modules
[
main_dcl_module_n
];
Assert
((
unsigned
int
)
iclF
unctionIndex
<
iclModule
->
bem_nFunctions
);
functionSymbol
=
&
iclModule
->
bem_functions
[
iclF
unctionIndex
];
Assert
((
unsigned
int
)
f
unctionIndex
<
iclModule
->
bem_nFunctions
);
functionSymbol
=
&
iclModule
->
bem_functions
[
f
unctionIndex
];
Assert
(
functionSymbol
->
symb_kind
==
definition
);
iclDef
=
functionSymbol
->
symb_def
;
...
...
@@ -3443,8 +3401,8 @@ BEExportFunction (int dclFunctionIndex, int iclFunctionIndex)
dclModule
=
&
gBEState
.
be_icl
.
beicl_dcl_module
;
Assert
((
unsigned
int
)
dclF
unctionIndex
<
dclModule
->
bem_nFunctions
);
functionSymbol
=
&
dclModule
->
bem_functions
[
dclF
unctionIndex
];
Assert
((
unsigned
int
)
f
unctionIndex
<
dclModule
->
bem_nFunctions
);
functionSymbol
=
&
dclModule
->
bem_functions
[
f
unctionIndex
];
Assert
(
functionSymbol
->
symb_kind
==
definition
);
dclDef
=
functionSymbol
->
symb_def
;
...
...
backendC/CleanCompilerSources/backend.h
View file @
ea2996f7
/* version info */
// increment this for every release
# define kBEVersionCurrent 0x020
10801
# define kBEVersionCurrent 0x020
30407
// 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 0x020
00213
# define kBEVersionOldestDefinition 0x020
30407
// 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 0x020
10801
# define kBEVersionOldestImplementation 0x020
30407
# define kBEDebug 1
...
...
@@ -430,18 +430,12 @@ Clean (BENoTypes :: BackEnd -> (BETypeP, BackEnd))
BEFlatTypeP
BEFlatType
(
BESymbolP
symbol
,
BETypeVarListP
arguments
);
Clean
(
BEFlatType
::
BESymbolP
BETypeVarListP
BackEnd
->
(
BEFlatTypeP
,
BackEnd
))
BEFlatTypeP
BEFlatTypeX
(
BESymbolP
symbol
,
BEAttribution
attribution
,
BETypeVarListP
arguments
);
Clean
(
BEFlatTypeX
::
BESymbolP
BEAttribution
BETypeVarListP
BackEnd
->
(
BEFlatTypeP
,
BackEnd
))
void
BEAlgebraicType
(
BEFlatTypeP
lhs
,
BEConstructorListP
constructors
);
Clean
(
BEAlgebraicType
::
BEFlatTypeP
BEConstructorListP
BackEnd
->
BackEnd
)
void
BERecordType
(
int
moduleIndex
,
BEFlatTypeP
lhs
,
BETypeNodeP
constructorType
,
BEFieldListP
fields
);
Clean
(
BERecordType
::
Int
BEFlatTypeP
BETypeNodeP
BEFieldListP
BackEnd
->
BackEnd
)
void
BERecordTypeX
(
int
moduleIndex
,
BEFlatTypeP
lhs
,
BETypeNodeP
constructorType
,
int
is_boxed_record
,
BEFieldListP
fields
);
Clean
(
BERecordTypeX
::
Int
BEFlatTypeP
BETypeNodeP
Int
BEFieldListP
BackEnd
->
BackEnd
)
void
BEAbsType
(
BEFlatTypeP
lhs
);
Clean
(
BEAbsType
::
BEFlatTypeP
BackEnd
->
BackEnd
)
...
...
@@ -529,20 +523,17 @@ Clean (BEDefineRules :: BEImpRuleP BackEnd -> BackEnd)
int
BEGenerateCode
(
CleanString
outputFile
);
Clean
(
BEGenerateCode
::
String
BackEnd
->
(
Bool
,
BackEnd
))
void
BEExportType
(
int
dclTypeIndex
,
int
iclTypeIndex
);
Clean
(
BEExportType
::
Int
Int
BackEnd
->
BackEnd
)
void
BESwapTypes
(
int
frm
,
int
to
);
Clean
(
BESwapTypes
::
Int
Int
BackEnd
->
BackEnd
)
void
BEExportType
(
int
isDictionary
,
int
typeIndex
);
Clean
(
BEExportType
::
Bool
Int
BackEnd
->
BackEnd
)
void
BEExportConstructor
(
int
dclConstructorIndex
,
int
iclC
onstructorIndex
);
Clean
(
BEExportConstructor
::
Int
Int
BackEnd
->
BackEnd
)
void
BEExportConstructor
(
int
c
onstructorIndex
);
Clean
(
BEExportConstructor
::
Int
BackEnd
->
BackEnd
)
void
BEExportField
(
int
dclTypeIndex
,
int
iclType
Index
);
Clean
(
BEExportField
::
Int
Int
BackEnd
->
BackEnd
)
void
BEExportField
(
int
isDictionaryField
,
int
field
Index
);
Clean
(
BEExportField
::
Bool
Int
BackEnd
->
BackEnd
)
void
BEExportFunction
(
int
dclFunctionIndex
,
int
iclF
unctionIndex
);
Clean
(
BEExportFunction
::
Int
Int
BackEnd
->
BackEnd
)
void
BEExportFunction
(
int
f
unctionIndex
);
Clean
(
BEExportFunction
::
Int
BackEnd
->
BackEnd
)
void
BEDefineImportedObjsAndLibs
(
BEStringListP
objs
,
BEStringListP
libs
);
Clean
(
BEDefineImportedObjsAndLibs
::
BEStringListP
BEStringListP
BackEnd
->
BackEnd
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment