]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libcc1/rpc.hh
New mklog script.
[thirdparty/gcc.git] / libcc1 / rpc.hh
index 560d27c9fdbc318fbacb8d8ca31edf6d65f641a9..f616124fabeed2195190234aa6e92c7a8a80ce40 100644 (file)
@@ -1,5 +1,5 @@
 /* RPC call and callback templates
-   Copyright (C) 2014-2016 Free Software Foundation, Inc.
+   Copyright (C) 2014-2020 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