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
7d7e4e41
Commit
7d7e4e41
authored
May 05, 2014
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Use backend interface for bound method expressions.
From-SVN: r210072
parent
7e7f8713
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
22 deletions
+12
-22
gcc/go/gofrontend/expressions.cc
+12
-22
No files found.
gcc/go/gofrontend/expressions.cc
View file @
7d7e4e41
...
@@ -6736,12 +6736,9 @@ Bound_method_expression::do_get_tree(Translate_context* context)
...
@@ -6736,12 +6736,9 @@ Bound_method_expression::do_get_tree(Translate_context* context)
Expression
*
ret
=
Expression
::
make_struct_composite_literal
(
st
,
vals
,
loc
);
Expression
*
ret
=
Expression
::
make_struct_composite_literal
(
st
,
vals
,
loc
);
ret
=
Expression
::
make_heap_expression
(
ret
,
loc
);
ret
=
Expression
::
make_heap_expression
(
ret
,
loc
);
tree
ret_tree
=
ret
->
get_tree
(
context
);
Expression
*
nil_check
=
NULL
;
// See whether the expression or any embedded pointers are nil.
// See whether the expression or any embedded pointers are nil.
Expression
*
nil_check
=
NULL
;
Expression
*
expr
=
this
->
expr_
;
Expression
*
expr
=
this
->
expr_
;
if
(
this
->
method_
->
field_indexes
()
!=
NULL
)
if
(
this
->
method_
->
field_indexes
()
!=
NULL
)
{
{
...
@@ -6764,26 +6761,19 @@ Bound_method_expression::do_get_tree(Translate_context* context)
...
@@ -6764,26 +6761,19 @@ Bound_method_expression::do_get_tree(Translate_context* context)
nil_check
=
Expression
::
make_binary
(
OPERATOR_OROR
,
nil_check
,
n
,
loc
);
nil_check
=
Expression
::
make_binary
(
OPERATOR_OROR
,
nil_check
,
n
,
loc
);
}
}
Bexpression
*
bme
=
tree_to_expr
(
ret
->
get_tree
(
context
));
if
(
nil_check
!=
NULL
)
if
(
nil_check
!=
NULL
)
{
{
tree
nil_check_tree
=
nil_check
->
get_tree
(
context
);
Gogo
*
gogo
=
context
->
gogo
();
Expression
*
crash_expr
=
Expression
*
crash
=
context
->
gogo
()
->
runtime_error
(
RUNTIME_ERROR_NIL_DEREFERENCE
,
loc
);
gogo
->
runtime_error
(
RUNTIME_ERROR_NIL_DEREFERENCE
,
loc
);
tree
crash
=
crash_expr
->
get_tree
(
context
);
Bexpression
*
bcrash
=
tree_to_expr
(
crash
->
get_tree
(
context
));
if
(
ret_tree
==
error_mark_node
Btype
*
btype
=
ret
->
type
()
->
get_backend
(
gogo
);
||
nil_check_tree
==
error_mark_node
Bexpression
*
bcheck
=
tree_to_expr
(
nil_check
->
get_tree
(
context
));
||
crash
==
error_mark_node
)
bme
=
gogo
->
backend
()
->
conditional_expression
(
btype
,
bcheck
,
bcrash
,
return
error_mark_node
;
bme
,
loc
);
}
ret_tree
=
fold_build2_loc
(
loc
.
gcc_location
(),
COMPOUND_EXPR
,
return
expr_to_tree
(
bme
);
TREE_TYPE
(
ret_tree
),
build3_loc
(
loc
.
gcc_location
(),
COND_EXPR
,
void_type_node
,
nil_check_tree
,
crash
,
NULL_TREE
),
ret_tree
);
}
return
ret_tree
;
}
}
// Dump ast representation of a bound method expression.
// Dump ast representation of a bound method 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