diff options
author | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-01-31 01:01:09 +0000 |
---|---|---|
committer | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-01-31 01:01:09 +0000 |
commit | 21b34f350bb82e3272a3967a076be848af6a2ca6 (patch) | |
tree | 2ecd98d407dc9ae43d7a9cbc9f5b44d9cca8106e /include | |
parent | 2bff1a27c02e9ef0f11fa811f54ccf6161bffa73 (diff) | |
download | gcc-21b34f350bb82e3272a3967a076be848af6a2ca6.tar.gz |
libcc1 base API: bump set_arguments; add set_driver_filename, set_triplet_regexp
for include/ChangeLog
* gcc-interface.h (enum gcc_base_api_version): Update comment
for GCC_FE_VERSION_1.
(struct gcc_base_vtable): Rename set_arguments to
set_arguments_v0. Add set_arguments, set_triplet_regexp and
set_driver_filename.
for libcc1/ChangeLog
* libcc1.cc (libcc1): Add class compiler with field compilerp,
class compiler_triplet_regexp and class
compiler_driver_filename.
(libcc1::libcc1): Initialize compilerp.
(libcc1::~libcc1): Delete compilerp.
(libcc1::compiler::find, libcc1::compiler_triplet_regexp::find)
(libcc1::compiler_driver_filename::find): New methods.
(libcc1_set_arguments): Remove parameter triplet_regexp.
(libcc1_set_triplet_regexp, libcc1_set_driver_filename)
(libcc1_set_arguments_v0): New functions.
(vtable): Use libcc1_set_arguments_v0, add
libcc1_set_arguments, libcc1_set_triplet_regexp and
libcc1_set_driver_filename.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245049 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 6 | ||||
-rw-r--r-- | include/gcc-interface.h | 61 |
2 files changed, 53 insertions, 14 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index 5284f104523..c1a52dbfca2 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,5 +1,11 @@ 2017-01-30 Jan Kratochvil <jan.kratochvil@redhat.com> + * gcc-interface.h (enum gcc_base_api_version): Update comment + for GCC_FE_VERSION_1. + (struct gcc_base_vtable): Rename set_arguments to + set_arguments_v0. Add set_arguments, set_triplet_regexp and + set_driver_filename. + * gcc-interface.h (enum gcc_base_api_version): Add comment to GCC_FE_VERSION_1. (struct gcc_base_vtable): Rename compile to compile_v0. diff --git a/include/gcc-interface.h b/include/gcc-interface.h index c98f0784545..e3ffd18a75d 100644 --- a/include/gcc-interface.h +++ b/include/gcc-interface.h @@ -46,7 +46,9 @@ enum gcc_base_api_version { GCC_FE_VERSION_0 = 0, - /* Deprecated method compile_v0. Added method set_verbose and compile. */ + /* 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, }; @@ -67,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. - - This returns NULL on success. On failure, returns a malloc()d - error message. The caller is responsible for freeing it. */ + /* Deprecated GCC_FE_VERSION_0 variant of the GCC_FE_VERSION_1 + methods set_triplet_regexp and set_arguments. */ - 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 @@ -125,6 +119,45 @@ struct gcc_base_vtable 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. */ |