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
06f7bf4c
Commit
06f7bf4c
authored
Apr 12, 2018
by
John van Groningen
Browse files
remove unused function PrintNodeSymbol, type UniVar and macro TestMark
parent
be69f92f
Changes
6
Hide whitespace changes
Inline
Side-by-side
backendC/CleanCompilerSources/buildtree.c
View file @
06f7bf4c
...
...
@@ -129,20 +129,6 @@ NewTypeVar (IdentP nid)
return
(
newnid
);
}
UniVar
NewUniVar
(
IdentP
id
)
{
UniVar
new_uni_var
;
new_uni_var
=
CompAllocType
(
struct
uni_var
);
new_uni_var
->
uv_ident
=
id
;
new_uni_var
->
uv_number
=
0
;
new_uni_var
->
uv_next_uni_var
=
NULL
;
return
(
new_uni_var
);
}
NodeP
NewNodeIdNode
(
NodeIdP
node_id
)
{
...
...
backendC/CleanCompilerSources/buildtree.h
View file @
06f7bf4c
...
...
@@ -49,7 +49,6 @@ extern NodeIdP NewNodeId (IdentP nid);
extern
StrictNodeIdP
NewStrictNodeId
(
NodeIdP
node_id
,
StrictNodeIdP
next
);
extern
StrictNodeIdP
NewStrictIdent
(
Ident
ident
,
StrictNodeIdP
next
);
extern
TypeVar
NewTypeVar
(
IdentP
nid
);
extern
UniVar
NewUniVar
(
IdentP
nid
);
extern
NodeDefs
NewNodeDefinition
(
NodeIdP
nid
,
NodeP
node
);
extern
SymbolP
NewSymbol
(
SymbKind
symbolKind
);
extern
TypeNode
NewTypeNode
(
Annotation
annot
,
AttributeKind
attr
,
SymbolP
symb
,
TypeArgs
args
,
int
arity
);
...
...
backendC/CleanCompilerSources/comsupport.c
View file @
06f7bf4c
...
...
@@ -26,7 +26,6 @@
#include
"buildtree.h"
#include
"comparser.h"
#include
"checker.h"
#include
"tcsupport.h"
#include
"statesgen.h"
#include
"codegen_types.h"
#include
"codegen1.h"
...
...
@@ -555,12 +554,6 @@ void StaticMessage (Bool error, char *symbol_format, char *message_format, ...)
case
'S'
:
PrintSymbol
(
va_arg
(
ap
,
Symbol
),
StdError
);
break
;
case
'N'
:
{
Node
node
=
va_arg
(
ap
,
Node
);
int
arg_nr
=
va_arg
(
ap
,
int
);
PrintNodeSymbol
(
node
,
arg_nr
,
StdError
);
break
;
}
default:
FPutC
(
'%'
,
StdError
);
FPutC
(
format_spec
,
StdError
);
...
...
backendC/CleanCompilerSources/syntax_tree_types.h
View file @
06f7bf4c
...
...
@@ -120,12 +120,3 @@ struct type_var
Ident
tv_ident
;
int
tv_argument_nr
;
};
#define TestMark(n,f,mask) (((n)->f & (mask)) != 0)
typedef
struct
uni_var
{
Ident
uv_ident
;
int
uv_number
;
struct
uni_var
*
uv_next_uni_var
;
}
*
UniVar
;
backendC/CleanCompilerSources/tcsupport.h
View file @
06f7bf4c
/*
Version 1.0 06/09/1995
Author: Sjaak Smetsers
*/
extern
void
PrintNodeSymbol
(
Node
node
,
int
arg_nr
,
File
file
);
backendC/CleanCompilerSources/tcsupport_2.c
View file @
06f7bf4c
/*
Version 1.2 21/01/1997
Author: Sjaak Smetsers
*/
#include
"compiledefines.h"
#include
"types.t"
#include
"system.h"
#include
"settings.h"
#include
"syntaxtr.t"
#include
"comsupport.h"
#include
"sizes.h"
#include
"checker.h"
#include
"checksupport.h"
#include
"typeconv.h"
#include
"tcsupport.h"
#include
"scanner.h"
#include
"comparser.h"
#include
"buildtree.h"
void
PrintNodeSymbol
(
Node
node
,
int
arg_nr
,
File
file
)
{
Symbol
rootsymb
;
switch
(
node
->
node_kind
)
{
case
IfNode
:
switch
(
arg_nr
)
{
case
1
:
FPutS
(
"condition part of guard or if rule"
,
file
);
return
;
case
2
:
FPutS
(
"then part of guard or if rule"
,
file
);
return
;
case
3
:
FPutS
(
"else part of guard or if rule"
,
file
);
return
;
default:
FPutS
(
"guard or if rule"
,
file
);
return
;
}
break
;
case
SelectorNode
:
if
(
arg_nr
==
1
)
FPutS
(
"argument of selection"
,
file
);
else
FPutS
(
"selection"
,
file
);
return
;
case
MatchNode
:
if
(
arg_nr
==
1
)
{
FPutS
(
"rhs selection of"
,
file
);
break
;
}
else
{
FPutS
(
"rhs selection"
,
file
);
return
;
}
case
UpdateNode
:
FPutS
(
"update of record"
,
file
);
break
;
case
NodeIdNode
:
if
(
node
->
node_node_id
->
nid_ident
!=
NULL
)
{
Ident
id
=
node
->
node_node_id
->
nid_ident
;
if
(
TestMark
(
node
->
node_node_id
,
nid_mark2
,
NID_FIELD_NAME_MASK
))
{
SymbDef
rec_symb
=
(
SymbDef
)
id
->
ident_environ
;
FPrintF
(
file
,
"field %s of record %s"
,
id
->
ident_name
,
rec_symb
->
sdef_ident
->
ident_name
);
}
else
FPutS
(
id
->
ident_name
,
file
);
}
else
if
(
node
->
node_node_id
->
nid_node
)
PrintNodeSymbol
(
node
->
node_node_id
->
nid_node
,
0
,
file
);
return
;
default:
break
;
}
rootsymb
=
node
->
node_symbol
;
if
(
rootsymb
->
symb_kind
==
select_symb
)
{
if
(
arg_nr
==
1
)
{
FPrintF
(
file
,
"%d-tuple selection of "
,
rootsymb
->
symb_arity
);
PrintNodeSymbol
(
node
->
node_arguments
->
arg_node
,
0
,
file
);
}
else
FPrintF
(
file
,
"selection of the %d-th argument of a %d-tuple "
,
node
->
node_arity
,
rootsymb
->
symb_arity
);
}
else
if
(
rootsymb
->
symb_kind
==
apply_symb
)
{
if
(
arg_nr
==
1
)
PrintNodeSymbol
(
node
->
node_arguments
->
arg_node
,
0
,
file
);
else
{
Node
argnode
;
for
(
arg_nr
=
1
,
argnode
=
node
->
node_arguments
->
arg_node
;
argnode
->
node_kind
==
NormalNode
&&
argnode
->
node_symbol
->
symb_kind
==
apply_symb
;
argnode
=
argnode
->
node_arguments
->
arg_node
)
arg_nr
++
;
PrintNodeSymbol
(
argnode
,
arg_nr
,
file
);
}
}
else
if
(
rootsymb
->
symb_kind
==
tuple_symb
)
{
int
tup_arity
=
node
->
node_arity
;
FPutS
(
"(_"
,
file
);
for
(
tup_arity
--
;
tup_arity
>
0
;
tup_arity
--
)
FPutS
(
",_"
,
file
);
FPutC
(
')'
,
file
);
}
else
{
if
(
arg_nr
>
0
)
FPrintF
(
StdError
,
"argument %d of "
,
arg_nr
);
PrintSymbol
(
rootsymb
,
file
);
}
}
/* PrintNodeSymbol */
Write
Preview
Supports
Markdown
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