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
3ac1e9ee
Commit
3ac1e9ee
authored
Jul 13, 2001
by
John van Groningen
Browse files
bug fix: reverse order of functions (in components)
(backendconvert.icl,backend.c)
parent
cc8dbec0
Changes
2
Hide whitespace changes
Inline
Side-by-side
backend/backendconvert.icl
View file @
3ac1e9ee
...
...
@@ -469,7 +469,7 @@ backEndConvertModulesH predefs {fe_icl =
=
(
backEnd
-*->
"backend done"
)
where
functionIndices
=
flatten
[[(
componentIndex
,
member
)
\\
member
<-
group
.
group_members
]
\\
group
<-:
fe_components
&
componentIndex
<-
[
0
..]]
=
flatten
[[(
componentIndex
,
member
)
\\
member
<-
group
.
group_members
]
\\
group
<-:
fe_components
&
componentIndex
<-
[
1
..]]
declareOtherDclModules
::
{#
DclModule
}
Int
NumberSet
->
BackEnder
declareOtherDclModules
dcls
main_dcl_module_n
used_module_numbers
...
...
@@ -705,9 +705,9 @@ instance declare {#a} | declareWithIndex a & Array {#} a where
declareFunctionSymbols
::
{#
FunDef
}
{#
Int
}
[(
Int
,
Int
)]
IndexRange
*
BackEndState
->
*
BackEndState
declareFunctionSymbols
functions
iclDclConversions
functionIndices
globalFunctions
backEnd
=
fold
r
(
declare
iclDclConversions
)
backEnd
[(
functionIndex
,
componentIndex
,
functions
.[
functionIndex
])
\\
(
componentIndex
,
functionIndex
)
<-
functionIndices
]
=
fold
l
(
declare
iclDclConversions
)
backEnd
[(
functionIndex
,
componentIndex
,
functions
.[
functionIndex
])
\\
(
componentIndex
,
functionIndex
)
<-
functionIndices
]
where
declare
iclDclConversions
(
functionIndex
,
componentIndex
,
function
)
backEnd
declare
iclDclConversions
backEnd
(
functionIndex
,
componentIndex
,
function
)
=
appBackEnd
(
BEDeclareFunction
(
functionName
function
.
fun_symb
.
id_name
functionIndex
iclDclConversions
globalFunctions
)
function
.
fun_arity
functionIndex
componentIndex
)
backEnd
where
...
...
backendC/CleanCompilerSources/backend.c
View file @
3ac1e9ee
...
...
@@ -29,7 +29,7 @@ extern void InitARC_Info (void); /* from typeconv.h */
# include <limits.h>
# if
1
# if
0
# include "dbprint.h"
# endif
...
...
@@ -387,7 +387,7 @@ BEDeclareIclModule (CleanString name, int nFunctions, int nTypes, int nConstruct
icl
->
beicl_module
=
ConvertAllocType
(
ImpRepr
);
icl
->
beicl_dcl_module
=
gBEState
.
be_modules
[
main_dcl_module_n
];
icl
->
beicl_previousAncestor
=
UINT_MAX
;
icl
->
beicl_previousAncestor
=
0
;
scc_dependency_list
=
NULL
;
icl
->
beicl_depsP
=
&
scc_dependency_list
;
...
...
@@ -414,7 +414,7 @@ BEDeclareIclModule (CleanString name, int nFunctions, int nTypes, int nConstruct
locallyGeneratedFunction
=
&
gLocallyGeneratedFunctions
[
i
];
DeclareFunctionC
(
locallyGeneratedFunction
->
lgf_name
,
locallyGeneratedFunction
->
lgf_arity
,
nFunctions
-
ArraySize
(
gLocallyGeneratedFunctions
)
+
i
,
UINT_MAX
);
DeclareFunctionC
(
locallyGeneratedFunction
->
lgf_name
,
locallyGeneratedFunction
->
lgf_arity
,
nFunctions
-
ArraySize
(
gLocallyGeneratedFunctions
)
+
i
,
0
);
}
/* +++ hack */
...
...
@@ -2187,7 +2187,7 @@ DeclareFunctionC (char *name, int arity, int functionIndex, unsigned int ancesto
functions
=
module
->
bem_functions
;
Assert
(
functions
!=
NULL
);
Assert
(
icl
->
beicl_previousAncestor
>
=
ancestor
);
Assert
(
icl
->
beicl_previousAncestor
<
=
ancestor
);
icl
->
beicl_previousAncestor
=
ancestor
;
Assert
(
functionIndex
<
module
->
bem_nFunctions
);
...
...
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