Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
f3dba894
Commit
f3dba894
authored
Dec 09, 2014
by
Trevor Saunders
Committed by
Trevor Saunders
Dec 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove param_is from nvptx
gcc/ * config/nvptx/nvptx.c: Convert htabs to hash_table. From-SVN: r218501
parent
13ef9090
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
28 deletions
+32
-28
gcc/ChangeLog
+4
-0
gcc/config/nvptx/nvptx.c
+28
-28
No files found.
gcc/ChangeLog
View file @
f3dba894
2014
-
12
-
08
Trevor
Saunders
<
tsaunders
@
mozilla
.
com
>
*
config
/
nvptx
/
nvptx
.
c
:
Convert
htabs
to
hash_table
.
2014
-
12
-
08
David
Edelsohn
<
dje
.
gcc
@
gmail
.
com
>
2014
-
12
-
08
David
Edelsohn
<
dje
.
gcc
@
gmail
.
com
>
PR
target
/
64226
PR
target
/
64226
gcc/config/nvptx/nvptx.c
View file @
f3dba894
...
@@ -56,12 +56,24 @@
...
@@ -56,12 +56,24 @@
/* Record the function decls we've written, and the libfuncs and function
/* Record the function decls we've written, and the libfuncs and function
decls corresponding to them. */
decls corresponding to them. */
static
std
::
stringstream
func_decls
;
static
std
::
stringstream
func_decls
;
static
GTY
((
if_marked
(
"ggc_marked_p"
),
param_is
(
struct
rtx_def
)))
htab_t
declared_libfuncs_htab
;
struct
declared_libfunc_hasher
:
ggc_cache_hasher
<
rtx
>
static
GTY
((
if_marked
(
"ggc_marked_p"
),
param_is
(
union
tree_node
)))
{
htab_t
declared_fndecls_htab
;
static
hashval_t
hash
(
rtx
x
)
{
return
htab_hash_pointer
(
x
);
}
static
GTY
((
if_marked
(
"ggc_marked_p"
),
param_is
(
union
tree_node
)))
static
bool
equal
(
rtx
a
,
rtx
b
)
{
return
a
==
b
;
}
htab_t
needed_fndecls_htab
;
};
static
GTY
((
cache
))
hash_table
<
declared_libfunc_hasher
>
*
declared_libfuncs_htab
;
struct
tree_hasher
:
ggc_cache_hasher
<
tree
>
{
static
hashval_t
hash
(
tree
t
)
{
return
htab_hash_pointer
(
t
);
}
static
bool
equal
(
tree
a
,
tree
b
)
{
return
a
==
b
;
}
};
static
GTY
((
cache
))
hash_table
<
tree_hasher
>
*
declared_fndecls_htab
;
static
GTY
((
cache
))
hash_table
<
tree_hasher
>
*
needed_fndecls_htab
;
/* Allocate a new, cleared machine_function structure. */
/* Allocate a new, cleared machine_function structure. */
...
@@ -86,12 +98,10 @@ nvptx_option_override (void)
...
@@ -86,12 +98,10 @@ nvptx_option_override (void)
write_symbols
=
NO_DEBUG
;
write_symbols
=
NO_DEBUG
;
debug_info_level
=
DINFO_LEVEL_NONE
;
debug_info_level
=
DINFO_LEVEL_NONE
;
declared_fndecls_htab
declared_fndecls_htab
=
hash_table
<
tree_hasher
>::
create_ggc
(
17
);
=
htab_create_ggc
(
17
,
htab_hash_pointer
,
htab_eq_pointer
,
NULL
);
needed_fndecls_htab
=
hash_table
<
tree_hasher
>::
create_ggc
(
17
);
needed_fndecls_htab
=
htab_create_ggc
(
17
,
htab_hash_pointer
,
htab_eq_pointer
,
NULL
);
declared_libfuncs_htab
declared_libfuncs_htab
=
h
tab_create_ggc
(
17
,
htab_hash_pointer
,
htab_eq_pointer
,
NULL
);
=
h
ash_table
<
declared_libfunc_hasher
>::
create_ggc
(
17
);
}
}
/* Return the mode to be used when declaring a ptx object for OBJ.
/* Return the mode to be used when declaring a ptx object for OBJ.
...
@@ -455,7 +465,7 @@ nvptx_record_fndecl (tree decl, bool force = false)
...
@@ -455,7 +465,7 @@ nvptx_record_fndecl (tree decl, bool force = false)
if
(
!
force
&&
TYPE_ARG_TYPES
(
TREE_TYPE
(
decl
))
==
NULL_TREE
)
if
(
!
force
&&
TYPE_ARG_TYPES
(
TREE_TYPE
(
decl
))
==
NULL_TREE
)
return
false
;
return
false
;
void
**
slot
=
htab_find_slot
(
declared_fndecls_htab
,
decl
,
INSERT
);
tree
*
slot
=
declared_fndecls_htab
->
find_slot
(
decl
,
INSERT
);
if
(
*
slot
==
NULL
)
if
(
*
slot
==
NULL
)
{
{
*
slot
=
decl
;
*
slot
=
decl
;
...
@@ -476,7 +486,7 @@ nvptx_record_needed_fndecl (tree decl)
...
@@ -476,7 +486,7 @@ nvptx_record_needed_fndecl (tree decl)
if
(
nvptx_record_fndecl
(
decl
))
if
(
nvptx_record_fndecl
(
decl
))
return
;
return
;
void
**
slot
=
htab_find_slot
(
needed_fndecls_htab
,
decl
,
INSERT
);
tree
*
slot
=
needed_fndecls_htab
->
find_slot
(
decl
,
INSERT
);
if
(
*
slot
==
NULL
)
if
(
*
slot
==
NULL
)
*
slot
=
decl
;
*
slot
=
decl
;
}
}
...
@@ -818,7 +828,7 @@ nvptx_expand_call (rtx retval, rtx address)
...
@@ -818,7 +828,7 @@ nvptx_expand_call (rtx retval, rtx address)
&&
(
decl_type
==
NULL_TREE
&&
(
decl_type
==
NULL_TREE
||
(
external_decl
&&
TYPE_ARG_TYPES
(
decl_type
)
==
NULL_TREE
)))
||
(
external_decl
&&
TYPE_ARG_TYPES
(
decl_type
)
==
NULL_TREE
)))
{
{
void
**
slot
=
htab_find_slot
(
declared_libfuncs_htab
,
callee
,
INSERT
);
rtx
*
slot
=
declared_libfuncs_htab
->
find_slot
(
callee
,
INSERT
);
if
(
*
slot
==
NULL
)
if
(
*
slot
==
NULL
)
{
{
*
slot
=
callee
;
*
slot
=
callee
;
...
@@ -2012,25 +2022,15 @@ nvptx_file_start (void)
...
@@ -2012,25 +2022,15 @@ nvptx_file_start (void)
fputs
(
"// END PREAMBLE
\n
"
,
asm_out_file
);
fputs
(
"// END PREAMBLE
\n
"
,
asm_out_file
);
}
}
/* Called through htab_traverse; call nvptx_record_fndecl for every
SLOT. */
static
int
write_one_fndecl
(
void
**
slot
,
void
*
)
{
tree
decl
=
(
tree
)
*
slot
;
nvptx_record_fndecl
(
decl
,
true
);
return
1
;
}
/* Write out the function declarations we've collected. */
/* Write out the function declarations we've collected. */
static
void
static
void
nvptx_file_end
(
void
)
nvptx_file_end
(
void
)
{
{
htab_traverse
(
needed_fndecls_htab
,
hash_table
<
tree_hasher
>::
iterator
iter
;
write_one_fndecl
,
tree
decl
;
NULL
);
FOR_EACH_HASH_TABLE_ELEMENT
(
*
needed_fndecls_htab
,
decl
,
tree
,
iter
)
nvptx_record_fndecl
(
decl
,
true
);
fputs
(
func_decls
.
str
().
c_str
(),
asm_out_file
);
fputs
(
func_decls
.
str
().
c_str
(),
asm_out_file
);
}
}
...
...
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