Skip to content

Commit a7e6265

Browse files
committed
Make m_data_sp a NonNullSharedPtr to enforce
that the shared pointer always has an object.
1 parent 04ef7eb commit a7e6265

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lldb/include/lldb/Symbol/ObjectFile.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "lldb/Utility/Endian.h"
1919
#include "lldb/Utility/FileSpec.h"
2020
#include "lldb/Utility/FileSpecList.h"
21+
#include "lldb/Utility/NonNullSharedPtr.h"
2122
#include "lldb/Utility/StructuredData.h"
2223
#include "lldb/Utility/UUID.h"
2324
#include "lldb/lldb-private.h"
@@ -777,6 +778,8 @@ class ObjectFile : public std::enable_shared_from_this<ObjectFile>,
777778
std::string GetObjectName() const;
778779

779780
protected:
781+
typedef NonNullSharedPtr<lldb_private::DataExtractor> DataExtractorNSP;
782+
780783
// Member variables.
781784
FileSpec m_file;
782785
Type m_type;
@@ -786,11 +789,10 @@ class ObjectFile : public std::enable_shared_from_this<ObjectFile>,
786789
lldb::addr_t m_length; ///< The length of this object file if it is known (can
787790
///be zero if length is unknown or can't be
788791
///determined).
789-
lldb::DataExtractorSP
790-
m_data_sp; ///< The data for this object file so things
791-
///< can be parsed lazily. This shared pointer
792-
///< will always have a DataExtractor object,
793-
///< although it may only be default-constructed.
792+
DataExtractorNSP m_data_sp; ///< The data for this object file so things
793+
///< can be parsed lazily. This shared pointer
794+
///< will always have a DataExtractor object,
795+
///< although it may only be default-constructed.
794796
lldb::ProcessWP m_process_wp;
795797
/// Set if the object file only exists in memory.
796798
const lldb::addr_t m_memory_addr;

0 commit comments

Comments
 (0)