Skip to content
GitLab
Menu
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
9fa28186
Commit
9fa28186
authored
Apr 21, 2021
by
John van Groningen
Browse files
refactor, in the backend rename nothing_symb as none_symb and nothing_sym as none_sym
parent
b7e0bb14
Changes
9
Hide whitespace changes
Inline
Side-by-side
backendC/CleanCompilerSources/backend.c
View file @
9fa28186
...
...
@@ -242,7 +242,7 @@ InitPredefinedSymbols (void)
gBasicSymbols
[
nil_symb
]
=
PredefinedSymbol
(
nil_symb
,
0
);
gBasicSymbols
[
cons_symb
]
=
PredefinedSymbol
(
cons_symb
,
2
);
gBasicSymbols
[
no
thing
_symb
]
=
PredefinedSymbol
(
no
thing
_symb
,
0
);
gBasicSymbols
[
no
ne
_symb
]
=
PredefinedSymbol
(
no
ne
_symb
,
0
);
gBasicSymbols
[
just_symb
]
=
PredefinedSymbol
(
just_symb
,
1
);
for
(
i
=
0
;
i
<
MaxNodeArity
;
i
++
)
...
...
@@ -1323,7 +1323,7 @@ void BEAdjustOverloadedNothingFunction (int functionIndex,int moduleIndex)
symbol_p
=&
gBEState
.
be_modules
[
moduleIndex
].
bem_functions
[
functionIndex
];
symbol_p
->
symb_kind
=
no
thing
_symb
;
symbol_p
->
symb_kind
=
no
ne
_symb
;
symbol_p
->
symb_head_strictness
=
OVERLOADED_CONS
;
}
...
...
backendC/CleanCompilerSources/codegen1.c
View file @
9fa28186
...
...
@@ -3650,7 +3650,7 @@ void generate_is_constructor (ImpRuleP rule)
GenEqDesc
(
&
cons_lab
,
case_node
->
node_arity
,
0
);
break
;
}
case
no
thing
_symb
:
case
no
ne
_symb
:
GenEqDesc
(
&
nothing_lab
,
case_node
->
node_arity
,
0
);
break
;
case
just_symb
:
...
...
@@ -4569,7 +4569,7 @@ static int generate_code_for_switch_node (NodeP node,int asp,int bsp,struct esc
}
}
break
;
case
no
thing
_symb
:
case
no
ne
_symb
:
if
(
case_number
==
1
){
GenJmp
(
&
case_label
);
matches_always
=
1
;
...
...
backendC/CleanCompilerSources/codegen2.c
View file @
9fa28186
...
...
@@ -3671,7 +3671,7 @@ static void FillNormalNode (Node node,int *asp_p,int *bsp_p,NodeId update_node_i
*
asp_p
-=
node
->
node_arity
;
}
return
;
case
no
thing
_symb
:
case
no
ne
_symb
:
if
((
symb
->
symb_head_strictness
&
1
)
&&
!
simple_expression_without_node_ids
(
node
->
node_arguments
->
arg_node
)){
BuildArg
(
node
->
node_arguments
,
asp_p
,
bsp_p
,
code_gen_node_ids_p
);
GenPopA
(
1
);
...
...
backendC/CleanCompilerSources/codegen3.c
View file @
9fa28186
...
...
@@ -1033,7 +1033,7 @@ static void CodeNormalRootNode (Node root,NodeId rootid,int asp,int bsp,CodeGenN
FillRhsRoot
(
&
nil_lab
,
root
,
asp
,
bsp
,
code_gen_node_ids_p
);
return
;
case
no
thing
_symb
:
case
no
ne
_symb
:
if
(
rootsymb
->
symb_head_strictness
&
1
){
if
(
!
simple_expression_without_node_ids
(
root
->
node_arguments
->
arg_node
)){
BuildArg
(
root
->
node_arguments
,
&
asp
,
&
bsp
,
code_gen_node_ids_p
);
...
...
backendC/CleanCompilerSources/comsupport.c
View file @
9fa28186
...
...
@@ -340,7 +340,7 @@ char *symbol_to_string (Symbol symbol)
return
"[]"
;
case
just_symb
:
return
"+?"
;
case
no
thing
_symb
:
case
no
ne
_symb
:
return
"-?"
;
case
select_symb
:
return
"_Select"
;
...
...
backendC/CleanCompilerSources/optimisations.c
View file @
9fa28186
...
...
@@ -1349,7 +1349,7 @@ static char *create_arguments_for_local_function (NodeP node_p,ArgS ***arg_h,Arg
#endif
#ifdef THUNK_LIFT_0_CONSTRUCTORS
case
nil_symb
:
case
no
thing
_symb
:
case
no
ne
_symb
:
if
(
arg_node
->
node_arity
==
0
){
NodeP
function_node
;
ArgP
new_arg
;
...
...
@@ -1591,7 +1591,7 @@ static char *create_arguments_for_local_function (NodeP node_p,ArgS ***arg_h,Arg
call_state_p
=&
node_id
->
nid_node
->
node_state
;
}
else
if
(
arg_node
->
node_kind
==
NormalNode
){
#ifdef STRICT_STATE_FOR_LAZY_TUPLE_CONSTRUCTORS
if
(
BETWEEN
(
tuple_symb
,
no
thing
_symb
,
arg_node
->
node_symbol
->
symb_kind
)
if
(
BETWEEN
(
tuple_symb
,
no
ne
_symb
,
arg_node
->
node_symbol
->
symb_kind
)
&&
!
(
arg_node
->
node_symbol
->
symb_kind
==
cons_symb
&&
(
arg_node
->
node_symbol
->
symb_head_strictness
>
LAZY_CONS
||
arg_node
->
node_symbol
->
symb_tail_strictness
))
&&
!
(
arg_node
->
node_symbol
->
symb_kind
==
just_symb
&&
arg_node
->
node_symbol
->
symb_head_strictness
>
LAZY_CONS
)
&&
arg_node
->
node_state
.
state_type
==
SimpleState
&&
arg_node
->
node_state
.
state_kind
==
OnA
)
...
...
@@ -2239,7 +2239,7 @@ static void optimise_normal_node (Node node)
#else
if
((
BETWEEN
(
int_denot
,
real_denot
,
symbol
->
symb_kind
)
||
symbol
->
symb_kind
==
string_denot
||
(
BETWEEN
(
tuple_symb
,
no
thing
_symb
,
symbol
->
symb_kind
)
||
(
BETWEEN
(
tuple_symb
,
no
ne
_symb
,
symbol
->
symb_kind
)
&&
!
(
symbol
->
symb_kind
==
cons_symb
&&
(
symbol
->
symb_head_strictness
>
1
||
symbol
->
symb_tail_strictness
))
&&
!
(
symbol
->
symb_kind
==
just_symb
&&
(
symbol
->
symb_head_strictness
>
1
))
)
...
...
@@ -3166,7 +3166,7 @@ static void optimise_strict_constructor_in_lazy_context (NodeP node,FreeUniqueNo
#endif
}
}
}
else
if
(
symbol
->
symb_kind
==
no
thing
_symb
){
}
else
if
(
symbol
->
symb_kind
==
no
ne
_symb
){
if
(
node
->
node_state
.
state_type
==
SimpleState
&&
node
->
node_state
.
state_kind
==
OnA
&&
node
->
node_arity
==
0
)
if
((
symbol
->
symb_head_strictness
&
1
)
==
0
)
node
->
node_state
.
state_kind
=
StrictOnA
;
...
...
backendC/CleanCompilerSources/sa.c
View file @
9fa28186
...
...
@@ -114,7 +114,7 @@ static Fun
*
tuplesym
[
MaxNodeArity
],
/* the tuple ids */
*
lazy_just_sym0
,
*
strict_just_sym0
,
*
no
thing
_sym
,
*
no
ne
_sym
,
*
strict_sym
[
MaxNrAnnots
],
/* the strict ids */
*
fail_sym
,
/* the fail id */
*
inffunct_sym
,
/* the E2 id */
...
...
@@ -2252,9 +2252,9 @@ static Exp ConvertNode (Node node, NodeId nid)
e
->
e_fun
=
lazy_just_sym0
+
arity
;
}
break
;
case
no
thing
_symb
:
case
no
ne
_symb
:
e
->
e_hnf
=
True
;
e
->
e_fun
=
no
thing
_sym
;
e
->
e_fun
=
no
ne
_sym
;
break
;
case
apply_symb
:
e
->
e_fun
=
apsym
;
...
...
@@ -2671,9 +2671,9 @@ static Exp convert_pattern (SymbolP symbol_p,int arity,NodeIdListElementP node_i
e
->
e_fun
=
lazy_just_sym0
+
arity
;
}
break
;
case
no
thing
_symb
:
case
no
ne
_symb
:
e
->
e_hnf
=
True
;
e
->
e_fun
=
no
thing
_sym
;
e
->
e_fun
=
no
ne
_sym
;
break
;
case
definition
:
{
...
...
@@ -3509,7 +3509,7 @@ static void init_predefined_symbols (void)
conssym
=
lazy_cons_sym0
+
2
;
#endif
no
thing
_sym
=
f
;
no
ne
_sym
=
f
;
f
->
fun_symbol
=
NULL
;
f
->
fun_arity
=
0
;
f
->
fun_kind
=
Constructor
;
...
...
backendC/CleanCompilerSources/statesgen.c
View file @
9fa28186
...
...
@@ -2113,7 +2113,7 @@ static Bool NodeInAStrictContext (Node node,StateS demanded_state,int local_scop
SetUnaryState
(
&
node
->
node_state
,
StrictOnA
,
MaybeObj
);
break
;
case
no
thing
_symb
:
case
no
ne
_symb
:
if
(
rootsymb
->
symb_head_strictness
&
1
)
parallel
=
DetermineStrictArgContext
(
node
->
node_arguments
,
StrictState
,
local_scope
);
...
...
backendC/CleanCompilerSources/syntaxtr.t
View file @
9fa28186
...
...
@@ -48,7 +48,7 @@ typedef enum {
integer_denot
,
string_denot
,
tuple_symb
,
cons_symb
,
just_symb
,
nil_symb
,
no
thing
_symb
,
cons_symb
,
just_symb
,
nil_symb
,
no
ne
_symb
,
apply_symb
,
if_symb
,
fail_symb
,
seq_symb
,
select_symb
,
Nr_Of_Predef_FunsOrConses
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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