aboutsummaryrefslogtreecommitdiff
path: root/gdb/btrace.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2024-02-03 14:32:06 -0700
committerTom Tromey <tom@tromey.com>2024-02-04 15:37:55 -0700
commitb36a26343a6c62b313d9e101b369155b6b799535 (patch)
treec5a73b5832f4ccbb914626230e2aeac11db0ab59 /gdb/btrace.c
parent029e52bac7f3a6dd8b39f7f3d298b73174da806b (diff)
downloadgdb-b36a26343a6c62b313d9e101b369155b6b799535.zip
gdb-b36a26343a6c62b313d9e101b369155b6b799535.tar.gz
gdb-b36a26343a6c62b313d9e101b369155b6b799535.tar.bz2
Use reference result of emplace_back
Starting with C++17, emplace_back returns a reference to the new object. This patch changes code that uses emplace_back followed by a call to back() to simply use this reference instead. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/btrace.c')
-rw-r--r--gdb/btrace.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/btrace.c b/gdb/btrace.c
index a2aaa20..b5a047b 100644
--- a/gdb/btrace.c
+++ b/gdb/btrace.c
@@ -255,8 +255,8 @@ ftrace_new_function (struct btrace_thread_info *btinfo,
insn_offset = prev->insn_offset + ftrace_call_num_insn (prev);
}
- btinfo->functions.emplace_back (mfun, fun, number, insn_offset, level);
- return &btinfo->functions.back ();
+ return &btinfo->functions.emplace_back (mfun, fun, number, insn_offset,
+ level);
}
/* Update the UP field of a function segment. */