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
13b61722
Commit
13b61722
authored
Jan 26, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Don't make type fns for private fields in other packages.
From-SVN: r183579
parent
e02ed81e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
gcc/go/gofrontend/gogo.cc
+17
-5
No files found.
gcc/go/gofrontend/gogo.cc
View file @
13b61722
...
...
@@ -1205,13 +1205,13 @@ Specific_type_functions::type(Type* t)
{
case
Type
:
:
TYPE_NAMED
:
{
Named_type
*
nt
=
t
->
named_type
();
if
(
!
t
->
compare_is_identity
(
this
->
gogo_
)
&&
t
->
is_comparable
())
t
->
type_functions
(
this
->
gogo_
,
t
->
named_type
(),
NULL
,
NULL
,
&
hash_fn
,
&
equal_fn
);
t
->
type_functions
(
this
->
gogo_
,
nt
,
NULL
,
NULL
,
&
hash_fn
,
&
equal_fn
);
// If this is a struct type, we don't want to make functions
// for the unnamed struct.
Type
*
rt
=
t
->
named_type
()
->
real_type
();
Type
*
rt
=
nt
->
real_type
();
if
(
rt
->
struct_type
()
==
NULL
)
{
if
(
Type
::
traverse
(
rt
,
this
)
==
TRAVERSE_EXIT
)
...
...
@@ -1219,8 +1219,20 @@ Specific_type_functions::type(Type* t)
}
else
{
if
(
rt
->
struct_type
()
->
traverse_field_types
(
this
)
==
TRAVERSE_EXIT
)
return
TRAVERSE_EXIT
;
// If this type is defined in another package, then we don't
// need to worry about the unexported fields.
bool
is_defined_elsewhere
=
nt
->
named_object
()
->
package
()
!=
NULL
;
const
Struct_field_list
*
fields
=
rt
->
struct_type
()
->
fields
();
for
(
Struct_field_list
::
const_iterator
p
=
fields
->
begin
();
p
!=
fields
->
end
();
++
p
)
{
if
(
is_defined_elsewhere
&&
Gogo
::
is_hidden_name
(
p
->
field_name
()))
continue
;
if
(
Type
::
traverse
(
p
->
type
(),
this
)
==
TRAVERSE_EXIT
)
return
TRAVERSE_EXIT
;
}
}
return
TRAVERSE_SKIP_COMPONENTS
;
...
...
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