summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-02-11 23:13:08 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-02-11 23:13:08 +0000
commit796ac80b863ed92c3d8bcc296f678ff416afc8a8 (patch)
tree2d135344aad0612c190b08cf7fd218d98a2a368b /lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
parent6cbc92915ae8f5cb1d5b265e15858e79c718e7ba (diff)
downloadbcm5719-llvm-796ac80b863ed92c3d8bcc296f678ff416afc8a8.tar.gz
bcm5719-llvm-796ac80b863ed92c3d8bcc296f678ff416afc8a8.zip
Use std::make_shared in LLDB (NFC)
Unlike std::make_unique, which is only available since C++14, std::make_shared is available since C++11. Not only is std::make_shared a lot more readable compared to ::reset(new), it also performs a single heap allocation for the object and control block. Differential revision: https://reviews.llvm.org/D57990 llvm-svn: 353764
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
index 1be4a3124b6..1c0bc94e943 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
@@ -11,6 +11,8 @@
//#define ENABLE_DEBUG_PRINTF // DO NOT LEAVE THIS DEFINED: DEBUG ONLY!!!
#include <assert.h>
+#include <memory>
+
#include "lldb/Core/FileSpecList.h"
#include "lldb/Core/Module.h"
#include "lldb/Host/Host.h"
@@ -48,7 +50,7 @@ void DWARFDebugLine::Parse(const DWARFDataExtractor &debug_line_data) {
// DEBUG_PRINTF("m_lineTableMap[0x%8.8x] = line_table_sp\n",
// debug_line_offset);
m_lineTableMap[debug_line_offset] = line_table_sp;
- line_table_sp.reset(new LineTable);
+ line_table_sp = std::make_shared<LineTable>();
} else
++offset; // Try next byte in line table
}
OpenPOWER on IntegriCloud