diff mbox

[v3,1/4] libcc1: Introduce GCC_FE_VERSION_1

Message ID 20150524185528.31662.76343.stgit@host1.jankratochvil.net
State New
Headers show

Commit Message

Jan Kratochvil May 24, 2015, 6:55 p.m. UTC
Hi,

the libcc1 API change formerly approved for GCC was rejected by GDB, therefore
here is a new API + its implementation.


Jan


include/ChangeLog
2015-05-24  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gcc-interface.h (enum gcc_base_api_version): Add GCC_FE_VERSION_1.

libcc1/ChangeLog
2015-05-24  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* libcc1.cc (vtable): Update to GCC_FE_VERSION_1.
	(gcc_c_fe_context): Accept also GCC_FE_VERSION_1.
---
 include/gcc-interface.h |    3 ++-
 libcc1/libcc1.cc        |    5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

Comments

Jan Kratochvil July 17, 2015, 6:26 p.m. UTC | #1
Hi,

I was asked now about this [PATCH v3 1..4] series for a possible inclusion of
its GDB patches counterpart into gdb-7.10.


Jan
diff mbox

Patch

diff --git a/include/gcc-interface.h b/include/gcc-interface.h
index 34010f2..dcfa6ce 100644
--- a/include/gcc-interface.h
+++ b/include/gcc-interface.h
@@ -44,7 +44,8 @@  struct gcc_base_context;
 
 enum gcc_base_api_version
 {
-  GCC_FE_VERSION_0 = 0
+  GCC_FE_VERSION_0 = 0,
+  GCC_FE_VERSION_1 = 1,
 };
 
 /* The operations defined by the GCC base API.  This is the vtable for
diff --git a/libcc1/libcc1.cc b/libcc1/libcc1.cc
index 7d7d2c1..99a0fa1 100644
--- a/libcc1/libcc1.cc
+++ b/libcc1/libcc1.cc
@@ -504,7 +504,7 @@  libcc1_destroy (struct gcc_base_context *s)
 
 static const struct gcc_base_vtable vtable =
 {
-  GCC_FE_VERSION_0,
+  GCC_FE_VERSION_1,
   libcc1_set_arguments,
   libcc1_set_source_file,
   libcc1_set_print_callback,
@@ -523,7 +523,8 @@  struct gcc_c_context *
 gcc_c_fe_context (enum gcc_base_api_version base_version,
 		  enum gcc_c_api_version c_version)
 {
-  if (base_version != GCC_FE_VERSION_0 || c_version != GCC_C_FE_VERSION_0)
+  if ((base_version != GCC_FE_VERSION_0 && base_version != GCC_FE_VERSION_1)
+      || c_version != GCC_C_FE_VERSION_0)
     return NULL;
 
   return new libcc1 (&vtable, &c_vtable);