diff options
author | Ian Lance Taylor <iant@google.com> | 2011-04-04 23:19:09 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-04-04 23:19:09 +0000 |
commit | 9403944776d0a804dbb1253430633d04aef74c51 (patch) | |
tree | 8d44210d8783d83e459d812c1f0df7bd37abb3c8 /gcc/go/gofrontend/backend.h | |
parent | 69387b92c18aa7fe8d29aa7788ae838a027b5d48 (diff) | |
download | gcc-9403944776d0a804dbb1253430633d04aef74c51.zip gcc-9403944776d0a804dbb1253430633d04aef74c51.tar.gz gcc-9403944776d0a804dbb1253430633d04aef74c51.tar.bz2 |
Use backend interface for return statements.
* go-gcc.cc: #include "tree-iterator.h", "gimple.h", and "gogo.h".
(class Bfunction): Define.
(Gcc_backend::assignment_statement): Rename from assignment.
Check for errors.
(Gcc_backend::return_statement): New function.
(tree_to_function): New function.
* Make-lang.in (go/go-gcc.o): Depend on tree-iterator.h,
$(GIMPLE_H), and $(GO_GOGO_H).
From-SVN: r171959
Diffstat (limited to 'gcc/go/gofrontend/backend.h')
-rw-r--r-- | gcc/go/gofrontend/backend.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/backend.h b/gcc/go/gofrontend/backend.h index babef83..959fc78 100644 --- a/gcc/go/gofrontend/backend.h +++ b/gcc/go/gofrontend/backend.h @@ -24,6 +24,9 @@ class Bexpression; // The backend representation of a statement. class Bstatement; +// The backend representation of a function definition. +class Bfunction; + // A list of backend types. typedef std::vector<Btype*> Btypes; @@ -103,7 +106,14 @@ class Backend // Create an assignment statement. virtual Bstatement* - assignment(Bexpression* lhs, Bexpression* rhs, source_location location) = 0; + assignment_statement(Bexpression* lhs, Bexpression* rhs, + source_location) = 0; + + // Create a return statement, passing the representation of the + // function and the list of values to return. + virtual Bstatement* + return_statement(Bfunction*, const std::vector<Bexpression*>&, + source_location) = 0; }; // The backend interface has to define this function. @@ -114,6 +124,7 @@ extern Backend* go_get_backend(); // interface. extern Bexpression* tree_to_expr(tree); +extern Bfunction* tree_to_function(tree); extern tree statement_to_tree(Bstatement*); #endif // !defined(GO_BACKEND_H) |