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
0c6caf5a
Commit
0c6caf5a
authored
Apr 19, 2011
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change general statement method to always use backend interface.
From-SVN: r172740
parent
fee8b6da
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
32 deletions
+33
-32
gcc/go/gofrontend/gogo-tree.cc
+2
-1
gcc/go/gofrontend/gogo.cc
+1
-1
gcc/go/gofrontend/statements.cc
+0
-0
gcc/go/gofrontend/statements.h
+30
-30
No files found.
gcc/go/gofrontend/gogo-tree.cc
View file @
0c6caf5a
...
@@ -1481,7 +1481,8 @@ Function::build_tree(Gogo* gogo, Named_object* named_function)
...
@@ -1481,7 +1481,8 @@ Function::build_tree(Gogo* gogo, Named_object* named_function)
{
{
Translate_context
dcontext
(
gogo
,
named_function
,
this
->
block_
,
Translate_context
dcontext
(
gogo
,
named_function
,
this
->
block_
,
tree_to_block
(
bind
));
tree_to_block
(
bind
));
defer_init
=
this
->
defer_stack_
->
get_tree
(
&
dcontext
);
Bstatement
*
bdi
=
this
->
defer_stack_
->
get_backend
(
&
dcontext
);
defer_init
=
stat_to_tree
(
bdi
);
}
}
}
}
...
...
gcc/go/gofrontend/gogo.cc
View file @
0c6caf5a
...
@@ -3320,7 +3320,7 @@ Block::get_backend(Translate_context* context)
...
@@ -3320,7 +3320,7 @@ Block::get_backend(Translate_context* context)
for
(
std
::
vector
<
Statement
*>::
const_iterator
p
=
this
->
statements_
.
begin
();
for
(
std
::
vector
<
Statement
*>::
const_iterator
p
=
this
->
statements_
.
begin
();
p
!=
this
->
statements_
.
end
();
p
!=
this
->
statements_
.
end
();
++
p
)
++
p
)
bstatements
.
push_back
(
tree_to_stat
((
*
p
)
->
get_tree
(
&
subcontext
)
));
bstatements
.
push_back
(
(
*
p
)
->
get_backend
(
&
subcontext
));
context
->
backend
()
->
block_add_statements
(
ret
,
bstatements
);
context
->
backend
()
->
block_add_statements
(
ret
,
bstatements
);
...
...
gcc/go/gofrontend/statements.cc
View file @
0c6caf5a
This diff is collapsed.
Click to expand it.
gcc/go/gofrontend/statements.h
View file @
0c6caf5a
...
@@ -367,9 +367,9 @@ class Statement
...
@@ -367,9 +367,9 @@ class Statement
may_fall_through
()
const
may_fall_through
()
const
{
return
this
->
do_may_fall_through
();
}
{
return
this
->
do_may_fall_through
();
}
//
Return the tree for a statement. BLOCK is the enclosing block
.
//
Convert the statement to the backend representation
.
tree
Bstatement
*
get_
tree
(
Translate_context
*
);
get_
backend
(
Translate_context
*
);
protected
:
protected
:
// Implemented by child class: traverse the tree.
// Implemented by child class: traverse the tree.
...
@@ -407,9 +407,9 @@ class Statement
...
@@ -407,9 +407,9 @@ class Statement
do_may_fall_through
()
const
do_may_fall_through
()
const
{
return
true
;
}
{
return
true
;
}
// Implemented by child class:
return a tree
.
// Implemented by child class:
convert to backend representation
.
virtual
tree
virtual
Bstatement
*
do_get_
tree
(
Translate_context
*
)
=
0
;
do_get_
backend
(
Translate_context
*
)
=
0
;
// Traverse an expression in a statement.
// Traverse an expression in a statement.
int
int
...
@@ -507,8 +507,8 @@ class Temporary_statement : public Statement
...
@@ -507,8 +507,8 @@ class Temporary_statement : public Statement
void
void
do_check_types
(
Gogo
*
);
do_check_types
(
Gogo
*
);
tree
Bstatement
*
do_get_
tree
(
Translate_context
*
);
do_get_
backend
(
Translate_context
*
);
private
:
private
:
// The type of the temporary variable.
// The type of the temporary variable.
...
@@ -541,8 +541,8 @@ class Variable_declaration_statement : public Statement
...
@@ -541,8 +541,8 @@ class Variable_declaration_statement : public Statement
bool
bool
do_traverse_assignments
(
Traverse_assignments
*
);
do_traverse_assignments
(
Traverse_assignments
*
);
tree
Bstatement
*
do_get_
tree
(
Translate_context
*
);
do_get_
backend
(
Translate_context
*
);
private
:
private
:
Named_object
*
var_
;
Named_object
*
var_
;
...
@@ -578,8 +578,8 @@ class Return_statement : public Statement
...
@@ -578,8 +578,8 @@ class Return_statement : public Statement
do_may_fall_through
()
const
do_may_fall_through
()
const
{
return
false
;
}
{
return
false
;
}
tree
Bstatement
*
do_get_
tree
(
Translate_context
*
);
do_get_
backend
(
Translate_context
*
);
private
:
private
:
// Return values. This may be NULL.
// Return values. This may be NULL.
...
@@ -614,8 +614,8 @@ class Send_statement : public Statement
...
@@ -614,8 +614,8 @@ class Send_statement : public Statement
void
void
do_check_types
(
Gogo
*
);
do_check_types
(
Gogo
*
);
tree
Bstatement
*
do_get_
tree
(
Translate_context
*
);
do_get_
backend
(
Translate_context
*
);
private
:
private
:
// The channel on which to send the value.
// The channel on which to send the value.
...
@@ -822,8 +822,8 @@ class Select_statement : public Statement
...
@@ -822,8 +822,8 @@ class Select_statement : public Statement
do_may_fall_through
()
const
do_may_fall_through
()
const
{
return
this
->
clauses_
->
may_fall_through
();
}
{
return
this
->
clauses_
->
may_fall_through
();
}
tree
Bstatement
*
do_get_
tree
(
Translate_context
*
);
do_get_
backend
(
Translate_context
*
);
private
:
private
:
// The select clauses.
// The select clauses.
...
@@ -912,8 +912,8 @@ class Go_statement : public Thunk_statement
...
@@ -912,8 +912,8 @@ class Go_statement : public Thunk_statement
{
}
{
}
protected
:
protected
:
tree
Bstatement
*
do_get_
tree
(
Translate_context
*
);
do_get_
backend
(
Translate_context
*
);
};
};
// A defer statement.
// A defer statement.
...
@@ -926,8 +926,8 @@ class Defer_statement : public Thunk_statement
...
@@ -926,8 +926,8 @@ class Defer_statement : public Thunk_statement
{
}
{
}
protected
:
protected
:
tree
Bstatement
*
do_get_
tree
(
Translate_context
*
);
do_get_
backend
(
Translate_context
*
);
};
};
// A label statement.
// A label statement.
...
@@ -949,8 +949,8 @@ class Label_statement : public Statement
...
@@ -949,8 +949,8 @@ class Label_statement : public Statement
int
int
do_traverse
(
Traverse
*
);
do_traverse
(
Traverse
*
);
tree
Bstatement
*
do_get_
tree
(
Translate_context
*
);
do_get_
backend
(
Translate_context
*
);
private
:
private
:
// The label.
// The label.
...
@@ -1001,8 +1001,8 @@ class For_statement : public Statement
...
@@ -1001,8 +1001,8 @@ class For_statement : public Statement
Statement
*
Statement
*
do_lower
(
Gogo
*
,
Named_object
*
,
Block
*
);
do_lower
(
Gogo
*
,
Named_object
*
,
Block
*
);
tree
Bstatement
*
do_get_
tree
(
Translate_context
*
)
do_get_
backend
(
Translate_context
*
)
{
gcc_unreachable
();
}
{
gcc_unreachable
();
}
private
:
private
:
...
@@ -1059,8 +1059,8 @@ class For_range_statement : public Statement
...
@@ -1059,8 +1059,8 @@ class For_range_statement : public Statement
Statement
*
Statement
*
do_lower
(
Gogo
*
,
Named_object
*
,
Block
*
);
do_lower
(
Gogo
*
,
Named_object
*
,
Block
*
);
tree
Bstatement
*
do_get_
tree
(
Translate_context
*
)
do_get_
backend
(
Translate_context
*
)
{
gcc_unreachable
();
}
{
gcc_unreachable
();
}
private
:
private
:
...
@@ -1288,8 +1288,8 @@ class Switch_statement : public Statement
...
@@ -1288,8 +1288,8 @@ class Switch_statement : public Statement
Statement
*
Statement
*
do_lower
(
Gogo
*
,
Named_object
*
,
Block
*
);
do_lower
(
Gogo
*
,
Named_object
*
,
Block
*
);
tree
Bstatement
*
do_get_
tree
(
Translate_context
*
)
do_get_
backend
(
Translate_context
*
)
{
gcc_unreachable
();
}
{
gcc_unreachable
();
}
private
:
private
:
...
@@ -1434,8 +1434,8 @@ class Type_switch_statement : public Statement
...
@@ -1434,8 +1434,8 @@ class Type_switch_statement : public Statement
Statement
*
Statement
*
do_lower
(
Gogo
*
,
Named_object
*
,
Block
*
);
do_lower
(
Gogo
*
,
Named_object
*
,
Block
*
);
tree
Bstatement
*
do_get_
tree
(
Translate_context
*
)
do_get_
backend
(
Translate_context
*
)
{
gcc_unreachable
();
}
{
gcc_unreachable
();
}
private
:
private
:
...
...
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