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
2b4171c3
Commit
2b4171c3
authored
Jun 21, 2013
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: do not skip compilation of blank-named functions.
Fixes issue 22. From-SVN: r200316
parent
b0ad3635
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
3 deletions
+22
-3
gcc/go/gofrontend/gogo-tree.cc
+8
-0
gcc/go/gofrontend/gogo.cc
+4
-3
gcc/go/gofrontend/gogo.h
+10
-0
No files found.
gcc/go/gofrontend/gogo-tree.cc
View file @
2b4171c3
...
...
@@ -829,6 +829,14 @@ Gogo::write_globals()
}
}
// Skip blank named functions.
if
(
no
->
is_function
()
&&
no
->
func_value
()
->
is_sink
())
{
--
i
;
--
count
;
continue
;
}
if
(
!
no
->
is_variable
())
{
vec
[
i
]
=
no
->
get_tree
(
this
,
NULL
);
...
...
gcc/go/gofrontend/gogo.cc
View file @
2b4171c3
...
...
@@ -819,7 +819,8 @@ Gogo::start_function(const std::string& name, Function_type* type,
char
buf
[
30
];
snprintf
(
buf
,
sizeof
buf
,
".$sink%d"
,
sink_count
);
++
sink_count
;
ret
=
Named_object
::
make_function
(
buf
,
NULL
,
function
);
ret
=
this
->
package_
->
bindings
()
->
add_function
(
buf
,
NULL
,
function
);
ret
->
func_value
()
->
set_is_sink
();
}
else
if
(
!
type
->
is_method
())
{
...
...
@@ -3253,8 +3254,8 @@ Function::Function(Function_type* type, Function* enclosing, Block* block,
:
type_
(
type
),
enclosing_
(
enclosing
),
results_
(
NULL
),
closure_var_
(
NULL
),
block_
(
block
),
location_
(
location
),
labels_
(),
local_type_count_
(
0
),
descriptor_
(
NULL
),
fndecl_
(
NULL
),
defer_stack_
(
NULL
),
results_are_named_
(
false
),
nointerface_
(
false
),
calls_recover
_
(
false
),
is_recover_thunk_
(
false
),
has_recover_thunk_
(
false
),
is_sink_
(
false
),
results_are_named_
(
false
),
nointerface
_
(
false
),
calls_recover_
(
false
),
is_recover_thunk_
(
false
),
has_recover_thunk_
(
false
),
in_unique_section_
(
false
),
is_descriptor_wrapper_
(
false
)
{
}
...
...
gcc/go/gofrontend/gogo.h
View file @
2b4171c3
...
...
@@ -911,6 +911,14 @@ class Function
result_variables
()
{
return
this
->
results_
;
}
bool
is_sink
()
const
{
return
this
->
is_sink_
;
}
void
set_is_sink
()
{
this
->
is_sink_
=
true
;
}
// Whether the result variables have names.
bool
results_are_named
()
const
...
...
@@ -1167,6 +1175,8 @@ class Function
// distinguish the defer stack for one function from another. This
// is NULL unless we actually need a defer stack.
Temporary_statement
*
defer_stack_
;
// True if this function is sink-named. No code is generated.
bool
is_sink_
:
1
;
// True if the result variables are named.
bool
results_are_named_
:
1
;
// True if this method should not be included in the type descriptor.
...
...
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