]> gcc.gnu.org Git - gcc.git/commitdiff
jit: Make recording::memento non-copyable
authorJonathan Wakely <jwakely@redhat.com>
Wed, 13 Jul 2022 11:28:11 +0000 (12:28 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 14 Jul 2022 20:20:43 +0000 (21:20 +0100)
gcc/jit/ChangeLog:

* jit-recording.h (recording::memento): Define copy constructor
and copy assignment operator as deleted.
(recording::string): Likewise.
(recording::string::c_str): Add const qualifier.

gcc/jit/jit-recording.h

index 0dfb42f26769662df256212781230f2d82f23ef4..8610ea988bdf51858f11c80181165d951ad68036 100644 (file)
@@ -405,6 +405,9 @@ public:
   virtual void write_reproducer (reproducer &r) = 0;
   virtual location *dyn_cast_location () { return NULL; }
 
+  memento (const memento&) = delete;
+  memento& operator= (const memento&) = delete;
+
 protected:
   memento (context *ctxt)
   : m_ctxt (ctxt),
@@ -436,13 +439,16 @@ public:
   string (context *ctxt, const char *text, bool escaped);
   ~string ();
 
-  const char *c_str () { return m_buffer; }
+  const char *c_str () const { return m_buffer; }
 
   static string * from_printf (context *ctxt, const char *fmt, ...)
     GNU_PRINTF(2, 3);
 
   void replay_into (replayer *) final override {}
 
+  string (const string&) = delete;
+  string& operator= (const string&) = delete;
+
 private:
   string * make_debug_string () final override;
   void write_reproducer (reproducer &r) final override;
This page took 0.068631 seconds and 5 git commands to generate.