summaryrefslogtreecommitdiff
path: root/libcc1/rpc.hh
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 /libcc1/rpc.hh
parentf733cf303bcdc952c92b81dd62199a40a1f555ec (diff)
downloadgcc-tarball-master.tar.gz
gcc-7.1.0gcc-7.1.0
Diffstat (limited to 'libcc1/rpc.hh')
-rw-r--r--libcc1/rpc.hh115
1 files changed, 113 insertions, 2 deletions
diff --git a/libcc1/rpc.hh b/libcc1/rpc.hh
index 58758d3d39..56a07c2b9d 100644
--- a/libcc1/rpc.hh
+++ b/libcc1/rpc.hh
@@ -1,5 +1,5 @@
/* RPC call and callback templates
- Copyright (C) 2014 Free Software Foundation, Inc.
+ Copyright (C) 2014-2017 Free Software Foundation, Inc.
This file is part of GCC.
@@ -21,7 +21,6 @@ along with GCC; see the file COPYING3. If not see
#define CC1_PLUGIN_RPC_HH
#include "status.hh"
-#include "marshall.hh"
#include "connection.hh"
namespace cc1_plugin
@@ -126,6 +125,118 @@ namespace cc1_plugin
argument_wrapper &operator= (const argument_wrapper &);
};
+#ifdef GCC_CP_INTERFACE_H
+ // Specialization for gcc_vbase_array.
+ template<>
+ class argument_wrapper<const gcc_vbase_array *>
+ {
+ public:
+ argument_wrapper () : m_object (NULL) { }
+ ~argument_wrapper ()
+ {
+ // It would be nicer if gcc_type_array could have a destructor.
+ // But, it is in code shared with gdb and cannot.
+ if (m_object != NULL)
+ {
+ delete[] m_object->flags;
+ delete[] m_object->elements;
+ }
+ delete m_object;
+ }
+
+ operator const gcc_vbase_array * () const
+ {
+ return m_object;
+ }
+
+ status unmarshall (connection *conn)
+ {
+ return ::cc1_plugin::unmarshall (conn, &m_object);
+ }
+
+ private:
+
+ gcc_vbase_array *m_object;
+
+ // No copying or assignment allowed.
+ argument_wrapper (const argument_wrapper &);
+ argument_wrapper &operator= (const argument_wrapper &);
+ };
+
+ // Specialization for gcc_cp_template_args.
+ template<>
+ class argument_wrapper<const gcc_cp_template_args *>
+ {
+ public:
+ argument_wrapper () : m_object (NULL) { }
+ ~argument_wrapper ()
+ {
+ // It would be nicer if gcc_type_array could have a destructor.
+ // But, it is in code shared with gdb and cannot.
+ if (m_object != NULL)
+ {
+ delete[] m_object->elements;
+ delete[] m_object->kinds;
+ }
+ delete m_object;
+ }
+
+ operator const gcc_cp_template_args * () const
+ {
+ return m_object;
+ }
+
+ status unmarshall (connection *conn)
+ {
+ return ::cc1_plugin::unmarshall (conn, &m_object);
+ }
+
+ private:
+
+ gcc_cp_template_args *m_object;
+
+ // No copying or assignment allowed.
+ argument_wrapper (const argument_wrapper &);
+ argument_wrapper &operator= (const argument_wrapper &);
+ };
+
+ // Specialization for gcc_cp_function_args.
+ template<>
+ class argument_wrapper<const gcc_cp_function_args *>
+ {
+ public:
+ argument_wrapper () : m_object (NULL) { }
+ ~argument_wrapper ()
+ {
+ // It would be nicer if gcc_type_array could have a destructor.
+ // But, it is in code shared with gdb and cannot.
+ if (m_object != NULL)
+ {
+ delete[] m_object->elements;
+ }
+ delete m_object;
+ }
+
+ operator const gcc_cp_function_args * () const
+ {
+ return m_object;
+ }
+
+ status unmarshall (connection *conn)
+ {
+ return ::cc1_plugin::unmarshall (conn, &m_object);
+ }
+
+ private:
+
+ gcc_cp_function_args *m_object;
+
+ // No copying or assignment allowed.
+ argument_wrapper (const argument_wrapper &);
+ argument_wrapper &operator= (const argument_wrapper &);
+ };
+#endif /* GCC_CP_INTERFACE_H */
+
// There are two kinds of template functions here: "call" and
// "callback". They are each repeated multiple times to handle
// different numbers of arguments. (This would be improved with