summaryrefslogtreecommitdiff
path: root/include/gcc-interface.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-05-02 14:43:35 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-05-02 14:43:35 +0000
commit34efdaf078b01a7387007c4e6bde6db86384c4b7 (patch)
treed503eaf41d085669d1481bb46ec038bc866fece6 /include/gcc-interface.h
parentf733cf303bcdc952c92b81dd62199a40a1f555ec (diff)
downloadgcc-tarball-master.tar.gz
gcc-7.1.0gcc-7.1.0
Diffstat (limited to 'include/gcc-interface.h')
-rw-r--r--include/gcc-interface.h111
1 files changed, 89 insertions, 22 deletions
diff --git a/include/gcc-interface.h b/include/gcc-interface.h
index df7db6ec1d..1dc3498e87 100644
--- a/include/gcc-interface.h
+++ b/include/gcc-interface.h
@@ -1,6 +1,6 @@
/* Generic interface between GCC and GDB
- Copyright (C) 2014-2015 Free Software Foundation, Inc.
+ Copyright (C) 2014-2017 Free Software Foundation, Inc.
This file is part of GCC.
@@ -44,7 +44,12 @@ struct gcc_base_context;
enum gcc_base_api_version
{
- GCC_FE_VERSION_0 = 0
+ GCC_FE_VERSION_0 = 0,
+
+ /* Deprecated methods set_arguments_v0 and compile_v0. Added methods
+ set_arguments, set_triplet_regexp, set_driver_filename, set_verbose and
+ compile. */
+ GCC_FE_VERSION_1 = 1,
};
/* The operations defined by the GCC base API. This is the vtable for
@@ -64,20 +69,12 @@ struct gcc_base_vtable
unsigned int version;
- /* Set the compiler's command-line options for the next compilation.
- TRIPLET_REGEXP is a regular expression that is used to match the
- configury triplet prefix to the compiler.
- The arguments are copied by GCC. ARGV need not be
- NULL-terminated. The arguments must be set separately for each
- compilation; that is, after a compile is requested, the
- previously-set arguments cannot be reused.
+ /* Deprecated GCC_FE_VERSION_0 variant of the GCC_FE_VERSION_1
+ methods set_triplet_regexp and set_arguments. */
- This returns NULL on success. On failure, returns a malloc()d
- error message. The caller is responsible for freeing it. */
-
- char *(*set_arguments) (struct gcc_base_context *self,
- const char *triplet_regexp,
- int argc, char **argv);
+ char *(*set_arguments_v0) (struct gcc_base_context *self,
+ const char *triplet_regexp,
+ int argc, char **argv);
/* Set the file name of the program to compile. The string is
copied by the method implementation, but the caller must
@@ -93,18 +90,74 @@ struct gcc_base_vtable
const char *message),
void *datum);
- /* Perform the compilation. FILENAME is the name of the resulting
- object file. VERBOSE can be set to cause GCC to print some
- information as it works. Returns true on success, false on
- error. */
+ /* Deprecated GCC_FE_VERSION_0 variant of the GCC_FE_VERSION_1
+ compile method. GCC_FE_VERSION_0 version verbose parameter has
+ been replaced by the set_verbose method. */
- int /* bool */ (*compile) (struct gcc_base_context *self,
- const char *filename,
- int /* bool */ verbose);
+ int /* bool */ (*compile_v0) (struct gcc_base_context *self,
+ const char *filename,
+ int /* bool */ verbose);
/* Destroy this object. */
void (*destroy) (struct gcc_base_context *self);
+
+ /* VERBOSE can be set to non-zero to cause GCC to print some
+ information as it works. Calling this method overrides its
+ possible previous calls.
+
+ This method is only available since GCC_FE_VERSION_1. */
+
+ void (*set_verbose) (struct gcc_base_context *self,
+ int /* bool */ verbose);
+
+ /* Perform the compilation. FILENAME is the name of the resulting
+ object file. Either set_triplet_regexp or set_driver_filename must
+ be called before. Returns true on success, false on error.
+
+ This method is only available since GCC_FE_VERSION_1. */
+
+ int /* bool */ (*compile) (struct gcc_base_context *self,
+ const char *filename);
+
+ /* Set the compiler's command-line options for the next compilation.
+ The arguments are copied by GCC. ARGV need not be
+ NULL-terminated. The arguments must be set separately for each
+ compilation; that is, after a compile is requested, the
+ previously-set arguments cannot be reused.
+
+ This returns NULL on success. On failure, returns a malloc()d
+ error message. The caller is responsible for freeing it.
+
+ This method is only available since GCC_FE_VERSION_1. */
+
+ char *(*set_arguments) (struct gcc_base_context *self,
+ int argc, char **argv);
+
+ /* Set TRIPLET_REGEXP as a regular expression that is used to match
+ the configury triplet prefix to the compiler. Calling this method
+ overrides possible previous call of itself or set_driver_filename.
+
+ This returns NULL on success. On failure, returns a malloc()d
+ error message. The caller is responsible for freeing it.
+
+ This method is only available since GCC_FE_VERSION_1. */
+
+ char *(*set_triplet_regexp) (struct gcc_base_context *self,
+ const char *triplet_regexp);
+
+ /* DRIVER_FILENAME should be filename of the gcc compiler driver
+ program. It will be searched in PATH components like
+ TRIPLET_REGEXP. Calling this method overrides possible previous
+ call of itself or set_triplet_regexp.
+
+ This returns NULL on success. On failure, returns a malloc()d
+ error message. The caller is responsible for freeing it.
+
+ This method is only available since GCC_FE_VERSION_1. */
+
+ char *(*set_driver_filename) (struct gcc_base_context *self,
+ const char *driver_filename);
};
/* The GCC object. */
@@ -116,6 +169,20 @@ struct gcc_base_context
const struct gcc_base_vtable *ops;
};
+/* An array of types used for creating function types in multiple
+ languages. */
+
+struct gcc_type_array
+{
+ /* Number of elements. */
+
+ int n_elements;
+
+ /* The elements. */
+
+ gcc_type *elements;
+};
+
/* The name of the dummy wrapper function generated by gdb. */
#define GCC_FE_WRAPPER_FUNCTION "_gdb_expr"