diff options
author | Tom Tromey <tom@tromey.com> | 2024-10-08 19:31:51 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2024-10-20 10:13:05 -0600 |
commit | 40ae603e6e0fe21fd0c1677dcf4e137cf99c2ebe (patch) | |
tree | 37b815b09eb8c8da38cd0846cdc7cd9136149167 /gdb/jit.c | |
parent | 32dc367249e85ecb2449d4be8cafc8e3fc2f359f (diff) | |
download | gdb-40ae603e6e0fe21fd0c1677dcf4e137cf99c2ebe.zip gdb-40ae603e6e0fe21fd0c1677dcf4e137cf99c2ebe.tar.gz gdb-40ae603e6e0fe21fd0c1677dcf4e137cf99c2ebe.tar.bz2 |
Use std::make_unique in more places
I searched for spots using ".reset (new ...)" and replaced most of
these with std::make_unique. I think this is a bit cleaner and more
idiomatic.
Regression tested on x86-64 Fedora 40.
Reviewed-By: Klaus Gerlicher<klaus.gerlicher@intel.com>
Diffstat (limited to 'gdb/jit.c')
-rw-r--r-- | gdb/jit.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -222,7 +222,7 @@ static jiter_objfile_data * get_jiter_objfile_data (objfile *objf) { if (objf->jiter_data == nullptr) - objf->jiter_data.reset (new jiter_objfile_data ()); + objf->jiter_data = std::make_unique<jiter_objfile_data> (); return objf->jiter_data.get (); } @@ -236,8 +236,9 @@ add_objfile_entry (struct objfile *objfile, CORE_ADDR entry, { gdb_assert (objfile->jited_data == nullptr); - objfile->jited_data.reset (new jited_objfile_data (entry, symfile_addr, - symfile_size)); + objfile->jited_data = std::make_unique<jited_objfile_data> (entry, + symfile_addr, + symfile_size); } /* Helper function for reading the global JIT descriptor from remote |