From 8d7a85c447ecd3ab42107f46b816884a546f8b3a Mon Sep 17 00:00:00 2001 From: Jeremy <51220084+jeremy-rifkin@users.noreply.github.com> Date: Tue, 4 Jun 2024 23:21:14 -0500 Subject: [PATCH] Update flatten_inlines to properly move inline frames instead of copying them and also clarify a comment --- src/symbols/symbols_with_libdwarf.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/symbols/symbols_with_libdwarf.cpp b/src/symbols/symbols_with_libdwarf.cpp index aa41488..c6d8891 100644 --- a/src/symbols/symbols_with_libdwarf.cpp +++ b/src/symbols/symbols_with_libdwarf.cpp @@ -44,8 +44,7 @@ namespace libdwarf { // .emplace needed, for some reason .insert tries to copy <= gcc 7.2 return resolver_map.emplace(object_name, std::move(resolver_object)).first->second.get(); } else { - // gcc cannot handle the following logic properly in <= gcc 5.1, so the type to be constructed is explicitly specified. - // See also:https://godbolt.org/z/9oWdWjbf8 + // gcc 4 has trouble with automatic moves of locals here https://godbolt.org/z/9oWdWjbf8 return maybe_owned{std::move(resolver_object)}; } } @@ -54,7 +53,7 @@ namespace libdwarf { // flatten trace with inlines std::vector flatten_inlines(std::vector& trace) { std::vector final_trace; - for(const auto& entry : trace) { + for(auto& entry : trace) { // most recent call first if(!entry.inlines.empty()) { // insert in reverse order