aboutsummaryrefslogtreecommitdiff
path: root/gcc/jit
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2022-07-13 12:28:11 +0100
committerJonathan Wakely <jwakely@redhat.com>2022-07-14 21:20:43 +0100
commitb4f81085d1ef5776be30f95c102ec67daf03c35c (patch)
tree1bbdef80ac30e43d139b5e9e496dfbcbd9597301 /gcc/jit
parent29f40a8047fa9b6ccde2174ca126b78a535e1a61 (diff)
downloadgcc-b4f81085d1ef5776be30f95c102ec67daf03c35c.zip
gcc-b4f81085d1ef5776be30f95c102ec67daf03c35c.tar.gz
gcc-b4f81085d1ef5776be30f95c102ec67daf03c35c.tar.bz2
jit: Make recording::memento non-copyable
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.
Diffstat (limited to 'gcc/jit')
-rw-r--r--gcc/jit/jit-recording.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/jit/jit-recording.h b/gcc/jit/jit-recording.h
index 0dfb42f..8610ea9 100644
--- a/gcc/jit/jit-recording.h
+++ b/gcc/jit/jit-recording.h
@@ -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;