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
9ed91ceb
Commit
9ed91ceb
authored
Dec 22, 2010
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix handling of named results for functions which call recover.
From-SVN: r168170
parent
46fc2305
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
gcc/go/gofrontend/gogo.cc
+19
-0
gcc/go/gofrontend/gogo.h
+11
-0
No files found.
gcc/go/gofrontend/gogo.cc
View file @
9ed91ceb
...
@@ -2177,6 +2177,10 @@ Build_recover_thunks::function(Named_object* orig_no)
...
@@ -2177,6 +2177,10 @@ Build_recover_thunks::function(Named_object* orig_no)
Convert_recover
convert_recover
(
can_recover_no
);
Convert_recover
convert_recover
(
can_recover_no
);
new_func
->
traverse
(
&
convert_recover
);
new_func
->
traverse
(
&
convert_recover
);
// Update the function pointers in any named results.
new_func
->
update_named_result_variables
();
orig_func
->
update_named_result_variables
();
return
TRAVERSE_CONTINUE
;
return
TRAVERSE_CONTINUE
;
}
}
...
@@ -2505,6 +2509,21 @@ Function::create_named_result_variables(Gogo* gogo)
...
@@ -2505,6 +2509,21 @@ Function::create_named_result_variables(Gogo* gogo)
}
}
}
}
// Update the named result variables when cloning a function which
// calls recover.
void
Function
::
update_named_result_variables
()
{
if
(
this
->
named_results_
==
NULL
)
return
;
for
(
Named_results
::
iterator
p
=
this
->
named_results_
->
begin
();
p
!=
this
->
named_results_
->
end
();
++
p
)
(
*
p
)
->
result_var_value
()
->
set_function
(
this
);
}
// Return the closure variable, creating it if necessary.
// Return the closure variable, creating it if necessary.
Named_object
*
Named_object
*
...
...
gcc/go/gofrontend/gogo.h
View file @
9ed91ceb
...
@@ -787,6 +787,11 @@ class Function
...
@@ -787,6 +787,11 @@ class Function
void
void
create_named_result_variables
(
Gogo
*
);
create_named_result_variables
(
Gogo
*
);
// Update the named result variables when cloning a function which
// calls recover.
void
update_named_result_variables
();
// Add a new field to the closure variable.
// Add a new field to the closure variable.
void
void
add_closure_field
(
Named_object
*
var
,
source_location
loc
)
add_closure_field
(
Named_object
*
var
,
source_location
loc
)
...
@@ -1318,6 +1323,12 @@ class Result_variable
...
@@ -1318,6 +1323,12 @@ class Result_variable
is_in_heap
()
const
is_in_heap
()
const
{
return
this
->
is_address_taken_
;
}
{
return
this
->
is_address_taken_
;
}
// Set the function. This is used when cloning functions which call
// recover.
void
set_function
(
Function
*
function
)
{
this
->
function_
=
function
;
}
private
:
private
:
// Type of result variable.
// Type of result variable.
Type
*
type_
;
Type
*
type_
;
...
...
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