Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
compiler
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
16
Issues
16
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
clean-compiler-and-rts
compiler
Commits
4baa8bab
Commit
4baa8bab
authored
May 22, 2019
by
johnvg@science.ru.nl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
only use hashtable for inlining from abc files of system modules
parent
30f20ecc
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
17 deletions
+35
-17
backendC/CleanCompilerSources/checker_2.c
backendC/CleanCompilerSources/checker_2.c
+2
-2
backendC/CleanCompilerSources/codegen1.c
backendC/CleanCompilerSources/codegen1.c
+3
-3
backendC/CleanCompilerSources/comparser_2.c
backendC/CleanCompilerSources/comparser_2.c
+5
-7
backendC/CleanCompilerSources/optimisations.c
backendC/CleanCompilerSources/optimisations.c
+1
-1
backendC/CleanCompilerSources/scanner.h
backendC/CleanCompilerSources/scanner.h
+2
-0
backendC/CleanCompilerSources/scanner_2.c
backendC/CleanCompilerSources/scanner_2.c
+21
-3
backendC/CleanCompilerSources/syntaxtr.t
backendC/CleanCompilerSources/syntaxtr.t
+1
-1
No files found.
backendC/CleanCompilerSources/checker_2.c
View file @
4baa8bab
...
...
@@ -122,9 +122,9 @@ NodeDefs NewNodeDef (NodeId nid,Node node)
void
InitChecker
(
void
)
{
StartSymbol
=
NewSymbol
(
newsymbol
);
StartSymbol
->
symb_ident
=
PutStringInHashTable
(
"Start"
,
SymbolIdTable
);
StartSymbol
->
symb_ident
=
NewIdent
(
"Start"
);
system_seq_id
=
PutStringInHashTable
(
"seq"
,
SymbolIdTable
);
system_seq_id
=
NewIdent
(
"seq"
);
OpenDefinitionModules
=
NIL
;
}
...
...
backendC/CleanCompilerSources/codegen1.c
View file @
4baa8bab
...
...
@@ -2599,7 +2599,7 @@ SymbDef CreateUpdateFunction (ArgS *record_arg,ArgS *first_field_arg,Node node
}
else
strict_record_state_p
=
&
record_state
;
update_function_ident
=
PutStringInHashTable
(
update_function_name
,
SymbolIdTabl
e
);
update_function_ident
=
NewIdent
(
update_function_nam
e
);
update_function_sdef
=
MakeNewSymbolDefinition
(
CurrentModule
,
update_function_ident
,
n_arguments
,
IMPRULE
);
update_function_sdef
->
sdef_number
=
next_def_number
++
;
...
...
@@ -2773,7 +2773,7 @@ SymbDef create_select_function (Symbol selector_symbol,int selector_kind)
sprintf
(
select_function_name
,
"_sel%d"
,
next_update_function_n
);
++
next_update_function_n
;
select_function_ident
=
PutStringInHashTable
(
select_function_name
,
SymbolIdTabl
e
);
select_function_ident
=
NewIdent
(
select_function_nam
e
);
select_function_sdef
=
MakeNewSymbolDefinition
(
CurrentModule
,
select_function_ident
,
1
,
IMPRULE
);
U5
(
select_function_sdef
,
sdef_number
=
next_def_number
++
,
...
...
@@ -2862,7 +2862,7 @@ static SymbDef create_match_function_sdef (void)
sprintf
(
match_function_name
,
"_match%d"
,
next_match_function_n
);
++
next_match_function_n
;
match_function_ident
=
PutStringInHashTable
(
match_function_name
,
SymbolIdTabl
e
);
match_function_ident
=
NewIdent
(
match_function_nam
e
);
match_function_sdef
=
MakeNewSymbolDefinition
(
CurrentModule
,
match_function_ident
,
1
,
IMPRULE
);
U5
(
match_function_sdef
,
sdef_number
=
next_def_number
++
,
...
...
backendC/CleanCompilerSources/comparser_2.c
View file @
4baa8bab
...
...
@@ -26,8 +26,6 @@
# include "dbprint.h"
# endif
static
void
*
gSymbIdEnv
;
static
IdentP
gBasicTypeIdents
[
Nr_Of_Basic_Types
],
gIfIdent
;
static
SymbolP
...
...
@@ -38,13 +36,13 @@ NewPredefinedTypeSymbol (SymbKind symbolKind, char *symbolName, IdentP *identPtr
symbol
=
NewSymbol
(
symbolKind
);
ident
=
PutStringInHashTable
(
symbolName
,
TypeSymbolIdTabl
e
);
ident
=
NewIdent
(
symbolNam
e
);
ident
->
ident_symbol
=
symbol
;
ident
->
ident_environ
=
(
char
*
)
gSymbIdEnv
;
ident
->
ident_environ
=
NULL
;
*
identPtr
=
ident
;
return
(
symbol
);
}
/* NewPredefinedSymbol */
}
static
SymbolP
NewPredefinedSymbol
(
SymbKind
symbolKind
,
char
*
symbolName
,
IdentP
*
identPtr
)
...
...
@@ -54,9 +52,9 @@ NewPredefinedSymbol (SymbKind symbolKind, char *symbolName, IdentP *identPtr)
symbol
=
NewSymbol
(
symbolKind
);
ident
=
PutStringInHashTable
(
symbolName
,
SymbolIdTabl
e
);
ident
=
NewIdent
(
symbolNam
e
);
ident
->
ident_symbol
=
symbol
;
ident
->
ident_environ
=
(
char
*
)
gSymbIdEnv
;
ident
->
ident_environ
=
NULL
;
*
identPtr
=
ident
;
return
(
symbol
);
...
...
backendC/CleanCompilerSources/optimisations.c
View file @
4baa8bab
...
...
@@ -1008,7 +1008,7 @@ static Symbol new_rule_symbol (char *function_name)
Symbol
function_symbol
;
Ident
function_ident
;
function_ident
=
PutStringInHashTable
(
function_name
,
SymbolIdTabl
e
);
function_ident
=
NewIdent
(
function_nam
e
);
function_sdef
=
MakeNewSymbolDefinition
(
CurrentModule
,
function_ident
,
0
,
IMPRULE
);
function_sdef
->
sdef_ancestor
=
~
next_def_number
;
...
...
backendC/CleanCompilerSources/scanner.h
View file @
4baa8bab
extern
IdentP
NewIdent
(
char
*
name
);
extern
IdentP
PutStringInHashTable
(
char
*
string
,
TableKind
tabkind
);
extern
void
InitScanner
(
void
);
...
...
backendC/CleanCompilerSources/scanner_2.c
View file @
4baa8bab
...
...
@@ -24,7 +24,7 @@
# include "sizes.h"
static
IdentP
NewIdent
(
TableKind
tableKind
,
char
*
name
)
NewIdent
InTable
(
TableKind
tableKind
,
char
*
name
)
{
IdentP
ident
;
...
...
@@ -39,7 +39,7 @@ NewIdent (TableKind tableKind, char *name)
ident
->
ident_mark
=
0
;
return
(
ident
);
}
/* NewIdent */
}
#define CompAllocString(size) ((char*)CompAlloc(size))
...
...
@@ -58,6 +58,24 @@ AllocString (char *string, short length)
return
(
newString
);
}
/* AllocString */
IdentP
NewIdent
(
char
*
name
)
{
IdentP
ident
;
ident
=
CompAllocType
(
struct
ident
);
ident
->
ident_name
=
AllocString
(
name
,
strlen
(
name
));
ident
->
ident_table
=
LastSystemModuleTable
;
ident
->
ident_next
=
NULL
;
ident
->
ident_environ
=
NULL
;
ident
->
ident_symbol
=
NULL
;
ident
->
ident_mark
=
0
;
return
ident
;
}
# define kIdentStringTableSizeBits 10
# define kIdentStringTableSize ((1 << kIdentStringTableSizeBits) - 1)
...
...
@@ -129,7 +147,7 @@ PutIdentStringInTable (IdentStringP identString, TableKind tableKind)
if
(
ident
==
NIL
)
{
ident
=
NewIdent
(
tableKind
,
identString
->
string
);
ident
=
NewIdent
InTable
(
tableKind
,
identString
->
string
);
ident
->
ident_next
=
identString
->
ident
;
...
...
backendC/CleanCompilerSources/syntaxtr.t
View file @
4baa8bab
...
...
@@ -105,7 +105,7 @@ typedef struct record_state_descr {
}
*RecordStateDescr
;
typedef
enum
{
SymbolIdTable
,
TypeSymbolIdTable
,
FirstSystemModuleTable
,
LastSystemModuleTable
=
0x7fff
FirstSystemModuleTable
,
LastSystemModuleTable
=
0x7fff
}
TableKind
;
typedef
union
symb_value
{
...
...
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