diff options
author | Chris Manghane <cmang@google.com> | 2013-10-11 03:15:33 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2013-10-11 03:15:33 +0000 |
commit | f7191ecdbd3adad32b561db40fac6978df6409fe (patch) | |
tree | 5f41fdf78ab663a67c63db5beabf5b7175f799ba /gcc/go/gofrontend/backend.h | |
parent | cf5e3504b55071f73420c3ab7756200b1dad7b7a (diff) | |
download | gcc-f7191ecdbd3adad32b561db40fac6978df6409fe.zip gcc-f7191ecdbd3adad32b561db40fac6978df6409fe.tar.gz gcc-f7191ecdbd3adad32b561db40fac6978df6409fe.tar.bz2 |
compiler: Use backend interface for function declarations.
* go-gcc.cc (Backend::error_function): New function.
(Backend::function): New function.
(Backend::make_function): New function.
(function_to_tree): New function.
From-SVN: r203403
Diffstat (limited to 'gcc/go/gofrontend/backend.h')
-rw-r--r-- | gcc/go/gofrontend/backend.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/backend.h b/gcc/go/gofrontend/backend.h index fa3e3cc..e73c98c 100644 --- a/gcc/go/gofrontend/backend.h +++ b/gcc/go/gofrontend/backend.h @@ -23,7 +23,7 @@ class Bexpression; // The backend representation of a statement. class Bstatement; -// The backend representation of a function definition. +// The backend representation of a function definition or declaration. class Bfunction; // The backend representation of a block. @@ -498,6 +498,32 @@ class Backend // recover. virtual Bexpression* label_address(Blabel*, Location) = 0; + + // Functions. + + // Create an error function. This is used for cases which should + // not occur in a correct program, in order to keep the compilation + // going without crashing. + virtual Bfunction* + error_function() = 0; + + // Declare or define a function of FNTYPE. + // NAME is the Go name of the function. ASM_NAME, if not the empty string, is + // the name that should be used in the symbol table; this will be non-empty if + // a magic extern comment is used. + // IS_VISIBLE is true if this function should be visible outside of the + // current compilation unit. IS_DECLARATION is true if this is a function + // declaration rather than a definition; the function definition will be in + // another compilation unit. + // IS_INLINABLE is true if the function can be inlined. + // DISABLE_SPLIT_STACK is true if this function may not split the stack; this + // is used for the implementation of recover. + // IN_UNIQUE_SECTION is true if this function should be put into a unique + // location if possible; this is used for field tracking. + virtual Bfunction* + function(Btype* fntype, const std::string& name, const std::string& asm_name, + bool is_visible, bool is_declaration, bool is_inlinable, + bool disable_split_stack, bool in_unique_section, Location) = 0; }; // The backend interface has to define this function. @@ -517,5 +543,6 @@ extern tree expr_to_tree(Bexpression*); extern tree stat_to_tree(Bstatement*); extern tree block_to_tree(Bblock*); extern tree var_to_tree(Bvariable*); +extern tree function_to_tree(Bfunction*); #endif // !defined(GO_BACKEND_H) |