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
535d5152
Commit
535d5152
authored
May 05, 2014
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Use backend interface for sink expressions.
From-SVN: r210078
parent
36d06319
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
gcc/go/gofrontend/expressions.cc
+16
-5
No files found.
gcc/go/gofrontend/expressions.cc
View file @
535d5152
...
@@ -931,7 +931,7 @@ class Sink_expression : public Expression
...
@@ -931,7 +931,7 @@ class Sink_expression : public Expression
public
:
public
:
Sink_expression
(
Location
location
)
Sink_expression
(
Location
location
)
:
Expression
(
EXPRESSION_SINK
,
location
),
:
Expression
(
EXPRESSION_SINK
,
location
),
type_
(
NULL
),
var_
(
NULL_TREE
)
type_
(
NULL
),
bvar_
(
NULL
)
{
}
{
}
protected
:
protected
:
...
@@ -959,7 +959,7 @@ class Sink_expression : public Expression
...
@@ -959,7 +959,7 @@ class Sink_expression : public Expression
// The type of this sink variable.
// The type of this sink variable.
Type
*
type_
;
Type
*
type_
;
// The temporary variable we generate.
// The temporary variable we generate.
tree
var_
;
Bvariable
*
b
var_
;
};
};
// Return the type of a sink expression.
// Return the type of a sink expression.
...
@@ -987,13 +987,24 @@ Sink_expression::do_determine_type(const Type_context* context)
...
@@ -987,13 +987,24 @@ Sink_expression::do_determine_type(const Type_context* context)
tree
tree
Sink_expression
::
do_get_tree
(
Translate_context
*
context
)
Sink_expression
::
do_get_tree
(
Translate_context
*
context
)
{
{
if
(
this
->
var_
==
NULL_TREE
)
Location
loc
=
this
->
location
();
Gogo
*
gogo
=
context
->
gogo
();
if
(
this
->
bvar_
==
NULL
)
{
{
go_assert
(
this
->
type_
!=
NULL
&&
!
this
->
type_
->
is_sink_type
());
go_assert
(
this
->
type_
!=
NULL
&&
!
this
->
type_
->
is_sink_type
());
Named_object
*
fn
=
context
->
function
();
go_assert
(
fn
!=
NULL
);
Bfunction
*
fn_ctx
=
fn
->
func_value
()
->
get_or_make_decl
(
gogo
,
fn
);
Btype
*
bt
=
this
->
type_
->
get_backend
(
context
->
gogo
());
Btype
*
bt
=
this
->
type_
->
get_backend
(
context
->
gogo
());
this
->
var_
=
create_tmp_var
(
type_to_tree
(
bt
),
"blank"
);
Bstatement
*
decl
;
this
->
bvar_
=
gogo
->
backend
()
->
temporary_variable
(
fn_ctx
,
context
->
bblock
(),
bt
,
NULL
,
false
,
loc
,
&
decl
);
Bexpression
*
var_ref
=
gogo
->
backend
()
->
var_expression
(
this
->
bvar_
,
loc
);
var_ref
=
gogo
->
backend
()
->
compound_expression
(
decl
,
var_ref
,
loc
);
return
expr_to_tree
(
var_ref
);
}
}
return
this
->
var_
;
return
expr_to_tree
(
gogo
->
backend
()
->
var_expression
(
this
->
bvar_
,
loc
))
;
}
}
// Ast dump for sink expression.
// Ast dump for sink expression.
...
...
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