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
f54d331e
Commit
f54d331e
authored
Apr 15, 2011
by
Ian Lance Taylor
Committed by
Ian Lance Taylor
Apr 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the backend interface for select statements.
From-SVN: r172468
parent
7427a368
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
10 deletions
+45
-10
gcc/go/ChangeLog
+4
-0
gcc/go/go-gcc.cc
+4
-0
gcc/go/gofrontend/backend.h
+6
-0
gcc/go/gofrontend/expressions.cc
+4
-3
gcc/go/gofrontend/runtime.cc
+9
-0
gcc/go/gofrontend/runtime.h
+9
-0
gcc/go/gofrontend/statements.cc
+0
-0
gcc/go/gofrontend/statements.h
+9
-7
No files found.
gcc/go/ChangeLog
View file @
f54d331e
2011-04-14 Ian Lance Taylor <iant@google.com>
* go-gcc.cc (Backend::error_statement): New function.
2011-04-13 Ian Lance Taylor <iant@google.com>
* Make-lang.in (go/gogo-tree.o): depend on $(GO_RUNTIME_H).
...
...
gcc/go/go-gcc.cc
View file @
f54d331e
...
...
@@ -167,6 +167,10 @@ class Gcc_backend : public Backend
// Statements.
Bstatement
*
error_statement
()
{
return
this
->
make_statement
(
error_mark_node
);
}
Bstatement
*
expression_statement
(
Bexpression
*
);
Bstatement
*
...
...
gcc/go/gofrontend/backend.h
View file @
f54d331e
...
...
@@ -107,6 +107,12 @@ class Backend
// Statements.
// Create an error statement. This is used for cases which should
// not occur in a correct program, in order to keep the compilation
// going without crashing.
virtual
Bstatement
*
error_statement
()
=
0
;
// Create an expression statement.
virtual
Bstatement
*
expression_statement
(
Bexpression
*
)
=
0
;
...
...
gcc/go/gofrontend/expressions.cc
View file @
f54d331e
...
...
@@ -3603,10 +3603,11 @@ Unsafe_type_conversion_expression::do_get_tree(Translate_context* context)
else
if
(
t
->
channel_type
()
!=
NULL
)
gcc_assert
(
et
->
channel_type
()
!=
NULL
);
else
if
(
t
->
points_to
()
!=
NULL
&&
t
->
points_to
()
->
channel_type
()
!=
NULL
)
gcc_assert
(
et
->
points_to
()
!=
NULL
&&
et
->
points_to
()
->
channel_type
()
!=
NULL
);
gcc_assert
((
et
->
points_to
()
!=
NULL
&&
et
->
points_to
()
->
channel_type
()
!=
NULL
)
||
et
->
is_nil_type
());
else
if
(
t
->
is_unsafe_pointer_type
())
gcc_assert
(
et
->
points_to
()
!=
NULL
);
gcc_assert
(
et
->
points_to
()
!=
NULL
||
et
->
is_nil_type
()
);
else
if
(
et
->
is_unsafe_pointer_type
())
gcc_assert
(
t
->
points_to
()
!=
NULL
);
else
if
(
t
->
interface_type
()
!=
NULL
&&
!
t
->
interface_type
()
->
is_empty
())
...
...
gcc/go/gofrontend/runtime.cc
View file @
f54d331e
...
...
@@ -381,3 +381,12 @@ Runtime::map_iteration_type()
return
Type
::
make_array_type
(
runtime_function_type
(
RFT_POINTER
),
iexpr
);
}
// Return the type used to pass a list of general channels to the
// select runtime function.
Type
*
Runtime
::
chanptr_type
()
{
return
runtime_function_type
(
RFT_CHANPTR
);
}
gcc/go/gofrontend/runtime.h
View file @
f54d331e
...
...
@@ -30,15 +30,24 @@ class Runtime
NUMBER_OF_FUNCTIONS
};
// Make a call to a runtime function.
static
Call_expression
*
make_call
(
Function
,
source_location
,
int
,
...);
// Convert all the types used by runtime functions to the backend
// representation.
static
void
convert_types
(
Gogo
*
);
// Return the type used for iterations over maps.
static
Type
*
map_iteration_type
();
// Return the type used to pass a list of general channels to the
// select runtime function.
static
Type
*
chanptr_type
();
private
:
static
Named_object
*
runtime_declaration
(
Function
);
...
...
gcc/go/gofrontend/statements.cc
View file @
f54d331e
This diff is collapsed.
Click to expand it.
gcc/go/gofrontend/statements.h
View file @
f54d331e
...
...
@@ -678,9 +678,9 @@ class Select_clauses
bool
may_fall_through
()
const
;
//
Return a tree implementing the select statement
.
tree
get_
tree
(
Translate_context
*
,
Unnamed_label
*
break_label
,
source_location
);
//
Convert to the backend representation
.
Bstatement
*
get_
backend
(
Translate_context
*
,
Unnamed_label
*
break_label
,
source_location
);
private
:
// A single clause.
...
...
@@ -749,8 +749,8 @@ class Select_clauses
may_fall_through
()
const
;
// Return a tree for the statements to execute.
tree
get_statements_
tree
(
Translate_context
*
);
Bstatement
*
get_statements_
backend
(
Translate_context
*
);
private
:
// The channel.
...
...
@@ -778,8 +778,10 @@ class Select_clauses
};
void
add_clause_tree
(
Translate_context
*
,
int
,
Select_clause
*
,
Unnamed_label
*
,
tree
*
);
add_clause_backend
(
Translate_context
*
,
source_location
,
int
index
,
int
case_value
,
Select_clause
*
,
Unnamed_label
*
,
std
::
vector
<
std
::
vector
<
Bexpression
*>
>*
cases
,
std
::
vector
<
Bstatement
*>*
clauses
);
typedef
std
::
vector
<
Select_clause
>
Clauses
;
...
...
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