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
5b26ad55
Commit
5b26ad55
authored
Dec 15, 2010
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Permit _ as a result variable name.
From-SVN: r167877
parent
354bc607
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
gcc/go/gofrontend/gogo.cc
+13
-6
gcc/go/gofrontend/gogo.h
+1
-1
No files found.
gcc/go/gofrontend/gogo.cc
View file @
5b26ad55
...
@@ -640,7 +640,7 @@ Gogo::start_function(const std::string& name, Function_type* type,
...
@@ -640,7 +640,7 @@ Gogo::start_function(const std::string& name, Function_type* type,
}
}
}
}
function
->
create_named_result_variables
();
function
->
create_named_result_variables
(
this
);
const
std
::
string
*
pname
;
const
std
::
string
*
pname
;
std
::
string
nested_name
;
std
::
string
nested_name
;
...
@@ -2473,7 +2473,7 @@ Function::Function(Function_type* type, Function* enclosing, Block* block,
...
@@ -2473,7 +2473,7 @@ Function::Function(Function_type* type, Function* enclosing, Block* block,
// Create the named result variables.
// Create the named result variables.
void
void
Function
::
create_named_result_variables
()
Function
::
create_named_result_variables
(
Gogo
*
gogo
)
{
{
const
Typed_identifier_list
*
results
=
this
->
type_
->
results
();
const
Typed_identifier_list
*
results
=
this
->
type_
->
results
();
if
(
results
==
NULL
if
(
results
==
NULL
...
@@ -2490,10 +2490,17 @@ Function::create_named_result_variables()
...
@@ -2490,10 +2490,17 @@ Function::create_named_result_variables()
p
!=
results
->
end
();
p
!=
results
->
end
();
++
p
,
++
index
)
++
p
,
++
index
)
{
{
Result_variable
*
result
=
new
Result_variable
(
p
->
type
(),
this
,
std
::
string
name
=
p
->
name
();
index
);
if
(
Gogo
::
is_sink_name
(
name
))
Named_object
*
no
=
block
->
bindings
()
->
add_result_variable
(
p
->
name
(),
{
result
);
static
int
unnamed_result_counter
;
char
buf
[
100
];
snprintf
(
buf
,
sizeof
buf
,
"_$%d"
,
unnamed_result_counter
);
++
unnamed_result_counter
;
name
=
gogo
->
pack_hidden_name
(
buf
,
false
);
}
Result_variable
*
result
=
new
Result_variable
(
p
->
type
(),
this
,
index
);
Named_object
*
no
=
block
->
bindings
()
->
add_result_variable
(
name
,
result
);
this
->
named_results_
->
push_back
(
no
);
this
->
named_results_
->
push_back
(
no
);
}
}
}
}
...
...
gcc/go/gofrontend/gogo.h
View file @
5b26ad55
...
@@ -785,7 +785,7 @@ class Function
...
@@ -785,7 +785,7 @@ class Function
// Create the named result variables in the outer block.
// Create the named result variables in the outer block.
void
void
create_named_result_variables
();
create_named_result_variables
(
Gogo
*
);
// Add a new field to the closure variable.
// Add a new field to the closure variable.
void
void
...
...
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