aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/go/gofrontend/backend.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.8/gcc/go/gofrontend/backend.h')
-rw-r--r--gcc-4.8/gcc/go/gofrontend/backend.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/gcc-4.8/gcc/go/gofrontend/backend.h b/gcc-4.8/gcc/go/gofrontend/backend.h
index fa3e3cc68..ca997f08a 100644
--- a/gcc-4.8/gcc/go/gofrontend/backend.h
+++ b/gcc-4.8/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.
@@ -266,6 +266,11 @@ class Backend
virtual Bexpression*
convert_expression(Btype* type, Bexpression* expr, Location) = 0;
+ // Create an expression for the address of a function. This is used to
+ // get the address of the code for a function.
+ virtual Bexpression*
+ function_code_expression(Bfunction*, Location) = 0;
+
// Statements.
// Create an error statement. This is used for cases which should
@@ -498,6 +503,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 +548,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)