[Lldb-commits] [lldb] r349821 - [API] Remove redundants get() from smart pointers. NFC
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Thu Dec 20 13:02:55 PST 2018
Author: jdevlieghere
Date: Thu Dec 20 13:02:55 2018
New Revision: 349821
URL: http://llvm.org/viewvc/llvm-project?rev=349821&view=rev
Log:
[API] Remove redundants get() from smart pointers. NFC
Removes redundant calls to ::get() from smart pointers in the source/API
directory..
Modified:
lldb/trunk/source/API/SBAddress.cpp
lldb/trunk/source/API/SBBreakpointName.cpp
lldb/trunk/source/API/SBCommandInterpreter.cpp
lldb/trunk/source/API/SBCommandReturnObject.cpp
lldb/trunk/source/API/SBDeclaration.cpp
lldb/trunk/source/API/SBError.cpp
lldb/trunk/source/API/SBFileSpec.cpp
lldb/trunk/source/API/SBFileSpecList.cpp
lldb/trunk/source/API/SBLineEntry.cpp
lldb/trunk/source/API/SBMemoryRegionInfoList.cpp
lldb/trunk/source/API/SBProcessInfo.cpp
lldb/trunk/source/API/SBSourceManager.cpp
lldb/trunk/source/API/SBStream.cpp
lldb/trunk/source/API/SBStringList.cpp
lldb/trunk/source/API/SBSymbolContext.cpp
lldb/trunk/source/API/SBSymbolContextList.cpp
lldb/trunk/source/API/SBType.cpp
lldb/trunk/source/API/SBTypeEnumMember.cpp
lldb/trunk/source/API/SBTypeSummary.cpp
lldb/trunk/source/API/SBValueList.cpp
lldb/trunk/source/API/SBVariablesOptions.cpp
Modified: lldb/trunk/source/API/SBAddress.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBAddress.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBAddress.cpp (original)
+++ lldb/trunk/source/API/SBAddress.cpp Thu Dec 20 13:02:55 2018
@@ -62,7 +62,7 @@ bool lldb::operator==(const SBAddress &l
}
bool SBAddress::IsValid() const {
- return m_opaque_ap.get() != NULL && m_opaque_ap->IsValid();
+ return m_opaque_ap != NULL && m_opaque_ap->IsValid();
}
void SBAddress::Clear() { m_opaque_ap.reset(new Address()); }
@@ -156,7 +156,7 @@ Address *SBAddress::operator->() { retur
const Address *SBAddress::operator->() const { return m_opaque_ap.get(); }
Address &SBAddress::ref() {
- if (m_opaque_ap.get() == NULL)
+ if (m_opaque_ap == NULL)
m_opaque_ap.reset(new Address());
return *m_opaque_ap;
}
Modified: lldb/trunk/source/API/SBBreakpointName.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBBreakpointName.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBBreakpointName.cpp (original)
+++ lldb/trunk/source/API/SBBreakpointName.cpp Thu Dec 20 13:02:55 2018
@@ -164,11 +164,11 @@ const SBBreakpointName &SBBreakpointName
}
bool SBBreakpointName::operator==(const lldb::SBBreakpointName &rhs) {
- return *m_impl_up.get() == *rhs.m_impl_up.get();
+ return *m_impl_up == *rhs.m_impl_up;
}
bool SBBreakpointName::operator!=(const lldb::SBBreakpointName &rhs) {
- return *m_impl_up.get() != *rhs.m_impl_up.get();
+ return *m_impl_up != *rhs.m_impl_up;
}
bool SBBreakpointName::IsValid() const {
Modified: lldb/trunk/source/API/SBCommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCommandInterpreter.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBCommandInterpreter.cpp (original)
+++ lldb/trunk/source/API/SBCommandInterpreter.cpp Thu Dec 20 13:02:55 2018
@@ -98,7 +98,7 @@ SBCommandInterpreterRunOptions::get() co
lldb_private::CommandInterpreterRunOptions &
SBCommandInterpreterRunOptions::ref() const {
- return *m_opaque_up.get();
+ return *m_opaque_up;
}
class CommandPluginInterfaceImplementation : public CommandObjectParsed {
Modified: lldb/trunk/source/API/SBCommandReturnObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCommandReturnObject.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBCommandReturnObject.cpp (original)
+++ lldb/trunk/source/API/SBCommandReturnObject.cpp Thu Dec 20 13:02:55 2018
@@ -48,9 +48,7 @@ operator=(const SBCommandReturnObject &r
return *this;
}
-bool SBCommandReturnObject::IsValid() const {
- return m_opaque_ap.get() != nullptr;
-}
+bool SBCommandReturnObject::IsValid() const { return m_opaque_ap != nullptr; }
const char *SBCommandReturnObject::GetOutput() {
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
Modified: lldb/trunk/source/API/SBDeclaration.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBDeclaration.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBDeclaration.cpp (original)
+++ lldb/trunk/source/API/SBDeclaration.cpp Thu Dec 20 13:02:55 2018
@@ -75,7 +75,7 @@ uint32_t SBDeclaration::GetLine() const
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
uint32_t line = 0;
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
line = m_opaque_ap->GetLine();
if (log)
@@ -86,7 +86,7 @@ uint32_t SBDeclaration::GetLine() const
}
uint32_t SBDeclaration::GetColumn() const {
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
return m_opaque_ap->GetColumn();
return 0;
}
@@ -126,7 +126,7 @@ const lldb_private::Declaration *SBDecla
}
lldb_private::Declaration &SBDeclaration::ref() {
- if (m_opaque_ap.get() == NULL)
+ if (m_opaque_ap == NULL)
m_opaque_ap.reset(new lldb_private::Declaration());
return *m_opaque_ap;
}
@@ -138,7 +138,7 @@ const lldb_private::Declaration &SBDecla
bool SBDeclaration::GetDescription(SBStream &description) {
Stream &strm = description.ref();
- if (m_opaque_ap.get()) {
+ if (m_opaque_ap) {
char file_path[PATH_MAX * 2];
m_opaque_ap->GetFile().GetPath(file_path, sizeof(file_path));
strm.Printf("%s:%u", file_path, GetLine());
Modified: lldb/trunk/source/API/SBError.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBError.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBError.cpp (original)
+++ lldb/trunk/source/API/SBError.cpp Thu Dec 20 13:02:55 2018
@@ -28,7 +28,7 @@ SBError::~SBError() {}
const SBError &SBError::operator=(const SBError &rhs) {
if (rhs.IsValid()) {
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
*m_opaque_ap = *rhs;
else
m_opaque_ap.reset(new Status(*rhs));
@@ -39,13 +39,13 @@ const SBError &SBError::operator=(const
}
const char *SBError::GetCString() const {
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
return m_opaque_ap->AsCString();
return NULL;
}
void SBError::Clear() {
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
m_opaque_ap->Clear();
}
@@ -53,7 +53,7 @@ bool SBError::Fail() const {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
bool ret_value = false;
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
ret_value = m_opaque_ap->Fail();
if (log)
@@ -66,7 +66,7 @@ bool SBError::Fail() const {
bool SBError::Success() const {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
bool ret_value = true;
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
ret_value = m_opaque_ap->Success();
if (log)
@@ -80,7 +80,7 @@ uint32_t SBError::GetError() const {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
uint32_t err = 0;
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
err = m_opaque_ap->GetError();
if (log)
@@ -93,7 +93,7 @@ uint32_t SBError::GetError() const {
ErrorType SBError::GetType() const {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
ErrorType err_type = eErrorTypeInvalid;
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
err_type = m_opaque_ap->GetType();
if (log)
@@ -137,10 +137,10 @@ int SBError::SetErrorStringWithFormat(co
return num_chars;
}
-bool SBError::IsValid() const { return m_opaque_ap.get() != NULL; }
+bool SBError::IsValid() const { return m_opaque_ap != NULL; }
void SBError::CreateIfNeeded() {
- if (m_opaque_ap.get() == NULL)
+ if (m_opaque_ap == NULL)
m_opaque_ap.reset(new Status());
}
@@ -159,7 +159,7 @@ const lldb_private::Status &SBError::ope
}
bool SBError::GetDescription(SBStream &description) {
- if (m_opaque_ap.get()) {
+ if (m_opaque_ap) {
if (m_opaque_ap->Success())
description.Printf("success");
else {
Modified: lldb/trunk/source/API/SBFileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFileSpec.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFileSpec.cpp (original)
+++ lldb/trunk/source/API/SBFileSpec.cpp Thu Dec 20 13:02:55 2018
@@ -148,12 +148,10 @@ const lldb_private::FileSpec *SBFileSpec
}
const lldb_private::FileSpec &SBFileSpec::operator*() const {
- return *m_opaque_ap.get();
+ return *m_opaque_ap;
}
-const lldb_private::FileSpec &SBFileSpec::ref() const {
- return *m_opaque_ap.get();
-}
+const lldb_private::FileSpec &SBFileSpec::ref() const { return *m_opaque_ap; }
void SBFileSpec::SetFileSpec(const lldb_private::FileSpec &fs) {
*m_opaque_ap = fs;
Modified: lldb/trunk/source/API/SBFileSpecList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFileSpecList.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFileSpecList.cpp (original)
+++ lldb/trunk/source/API/SBFileSpecList.cpp Thu Dec 20 13:02:55 2018
@@ -26,7 +26,7 @@ SBFileSpecList::SBFileSpecList() : m_opa
SBFileSpecList::SBFileSpecList(const SBFileSpecList &rhs) : m_opaque_ap() {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (rhs.m_opaque_ap.get())
+ if (rhs.m_opaque_ap)
m_opaque_ap.reset(new FileSpecList(*(rhs.get())));
if (log) {
@@ -78,17 +78,17 @@ const lldb_private::FileSpecList *SBFile
}
const lldb_private::FileSpecList &SBFileSpecList::operator*() const {
- return *m_opaque_ap.get();
+ return *m_opaque_ap;
}
const lldb_private::FileSpecList &SBFileSpecList::ref() const {
- return *m_opaque_ap.get();
+ return *m_opaque_ap;
}
bool SBFileSpecList::GetDescription(SBStream &description) const {
Stream &strm = description.ref();
- if (m_opaque_ap.get()) {
+ if (m_opaque_ap) {
uint32_t num_files = m_opaque_ap->GetSize();
strm.Printf("%d files: ", num_files);
for (uint32_t i = 0; i < num_files; i++) {
Modified: lldb/trunk/source/API/SBLineEntry.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBLineEntry.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBLineEntry.cpp (original)
+++ lldb/trunk/source/API/SBLineEntry.cpp Thu Dec 20 13:02:55 2018
@@ -50,7 +50,7 @@ SBLineEntry::~SBLineEntry() {}
SBAddress SBLineEntry::GetStartAddress() const {
SBAddress sb_address;
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
sb_address.SetAddress(&m_opaque_ap->range.GetBaseAddress());
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
@@ -70,7 +70,7 @@ SBAddress SBLineEntry::GetStartAddress()
SBAddress SBLineEntry::GetEndAddress() const {
SBAddress sb_address;
- if (m_opaque_ap.get()) {
+ if (m_opaque_ap) {
sb_address.SetAddress(&m_opaque_ap->range.GetBaseAddress());
sb_address.OffsetAddress(m_opaque_ap->range.GetByteSize());
}
@@ -114,7 +114,7 @@ uint32_t SBLineEntry::GetLine() const {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
uint32_t line = 0;
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
line = m_opaque_ap->line;
if (log)
@@ -125,7 +125,7 @@ uint32_t SBLineEntry::GetLine() const {
}
uint32_t SBLineEntry::GetColumn() const {
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
return m_opaque_ap->column;
return 0;
}
@@ -165,7 +165,7 @@ const lldb_private::LineEntry *SBLineEnt
}
lldb_private::LineEntry &SBLineEntry::ref() {
- if (m_opaque_ap.get() == NULL)
+ if (m_opaque_ap == NULL)
m_opaque_ap.reset(new lldb_private::LineEntry());
return *m_opaque_ap;
}
@@ -175,7 +175,7 @@ const lldb_private::LineEntry &SBLineEnt
bool SBLineEntry::GetDescription(SBStream &description) {
Stream &strm = description.ref();
- if (m_opaque_ap.get()) {
+ if (m_opaque_ap) {
char file_path[PATH_MAX * 2];
m_opaque_ap->file.GetPath(file_path, sizeof(file_path));
strm.Printf("%s:%u", file_path, GetLine());
Modified: lldb/trunk/source/API/SBMemoryRegionInfoList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBMemoryRegionInfoList.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBMemoryRegionInfoList.cpp (original)
+++ lldb/trunk/source/API/SBMemoryRegionInfoList.cpp Thu Dec 20 13:02:55 2018
@@ -129,5 +129,5 @@ const MemoryRegionInfoListImpl *SBMemory
const MemoryRegionInfoListImpl &SBMemoryRegionInfoList::operator*() const {
assert(m_opaque_ap.get());
- return *m_opaque_ap.get();
+ return *m_opaque_ap;
}
Modified: lldb/trunk/source/API/SBProcessInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBProcessInfo.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBProcessInfo.cpp (original)
+++ lldb/trunk/source/API/SBProcessInfo.cpp Thu Dec 20 13:02:55 2018
@@ -36,7 +36,7 @@ SBProcessInfo &SBProcessInfo::operator=(
}
ProcessInstanceInfo &SBProcessInfo::ref() {
- if (m_opaque_ap.get() == nullptr) {
+ if (m_opaque_ap == nullptr) {
m_opaque_ap.reset(new ProcessInstanceInfo());
}
return *m_opaque_ap;
@@ -46,7 +46,7 @@ void SBProcessInfo::SetProcessInfo(const
ref() = proc_info_ref;
}
-bool SBProcessInfo::IsValid() const { return m_opaque_ap.get() != nullptr; }
+bool SBProcessInfo::IsValid() const { return m_opaque_ap != nullptr; }
const char *SBProcessInfo::GetName() {
const char *name = nullptr;
Modified: lldb/trunk/source/API/SBSourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBSourceManager.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBSourceManager.cpp (original)
+++ lldb/trunk/source/API/SBSourceManager.cpp Thu Dec 20 13:02:55 2018
@@ -107,7 +107,7 @@ size_t SBSourceManager::DisplaySourceLin
const SBFileSpec &file, uint32_t line, uint32_t column,
uint32_t context_before, uint32_t context_after,
const char *current_line_cstr, SBStream &s) {
- if (m_opaque_ap.get() == NULL)
+ if (m_opaque_ap == NULL)
return 0;
return m_opaque_ap->DisplaySourceLinesWithLineNumbers(
Modified: lldb/trunk/source/API/SBStream.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBStream.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBStream.cpp (original)
+++ lldb/trunk/source/API/SBStream.cpp Thu Dec 20 13:02:55 2018
@@ -25,12 +25,12 @@ SBStream::SBStream(SBStream &&rhs)
SBStream::~SBStream() {}
-bool SBStream::IsValid() const { return (m_opaque_ap.get() != NULL); }
+bool SBStream::IsValid() const { return (m_opaque_ap != NULL); }
// If this stream is not redirected to a file, it will maintain a local cache
// for the stream data which can be accessed using this accessor.
const char *SBStream::GetData() {
- if (m_is_file || m_opaque_ap.get() == NULL)
+ if (m_is_file || m_opaque_ap == NULL)
return NULL;
return static_cast<StreamString *>(m_opaque_ap.get())->GetData();
@@ -39,7 +39,7 @@ const char *SBStream::GetData() {
// If this stream is not redirected to a file, it will maintain a local cache
// for the stream output whose length can be accessed using this accessor.
size_t SBStream::GetSize() {
- if (m_is_file || m_opaque_ap.get() == NULL)
+ if (m_is_file || m_opaque_ap == NULL)
return 0;
return static_cast<StreamString *>(m_opaque_ap.get())->GetSize();
@@ -59,7 +59,7 @@ void SBStream::RedirectToFile(const char
return;
std::string local_data;
- if (m_opaque_ap.get()) {
+ if (m_opaque_ap) {
// See if we have any locally backed data. If so, copy it so we can then
// redirect it to the file so we don't lose the data
if (!m_is_file)
@@ -76,7 +76,7 @@ void SBStream::RedirectToFile(const char
open_options);
m_opaque_ap.reset(stream_file);
- if (m_opaque_ap.get()) {
+ if (m_opaque_ap) {
m_is_file = true;
// If we had any data locally in our StreamString, then pass that along to
@@ -92,7 +92,7 @@ void SBStream::RedirectToFileHandle(FILE
return;
std::string local_data;
- if (m_opaque_ap.get()) {
+ if (m_opaque_ap) {
// See if we have any locally backed data. If so, copy it so we can then
// redirect it to the file so we don't lose the data
if (!m_is_file)
@@ -100,7 +100,7 @@ void SBStream::RedirectToFileHandle(FILE
}
m_opaque_ap.reset(new StreamFile(fh, transfer_fh_ownership));
- if (m_opaque_ap.get()) {
+ if (m_opaque_ap) {
m_is_file = true;
// If we had any data locally in our StreamString, then pass that along to
@@ -113,7 +113,7 @@ void SBStream::RedirectToFileHandle(FILE
void SBStream::RedirectToFileDescriptor(int fd, bool transfer_fh_ownership) {
std::string local_data;
- if (m_opaque_ap.get()) {
+ if (m_opaque_ap) {
// See if we have any locally backed data. If so, copy it so we can then
// redirect it to the file so we don't lose the data
if (!m_is_file)
@@ -121,7 +121,7 @@ void SBStream::RedirectToFileDescriptor(
}
m_opaque_ap.reset(new StreamFile(::fdopen(fd, "w"), transfer_fh_ownership));
- if (m_opaque_ap.get()) {
+ if (m_opaque_ap) {
m_is_file = true;
// If we had any data locally in our StreamString, then pass that along to
@@ -137,13 +137,13 @@ lldb_private::Stream *SBStream::operator
lldb_private::Stream *SBStream::get() { return m_opaque_ap.get(); }
lldb_private::Stream &SBStream::ref() {
- if (m_opaque_ap.get() == NULL)
+ if (m_opaque_ap == NULL)
m_opaque_ap.reset(new StreamString());
- return *m_opaque_ap.get();
+ return *m_opaque_ap;
}
void SBStream::Clear() {
- if (m_opaque_ap.get()) {
+ if (m_opaque_ap) {
// See if we have any locally backed data. If so, copy it so we can then
// redirect it to the file so we don't lose the data
if (m_is_file)
Modified: lldb/trunk/source/API/SBStringList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBStringList.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBStringList.cpp (original)
+++ lldb/trunk/source/API/SBStringList.cpp Thu Dec 20 13:02:55 2018
@@ -47,7 +47,7 @@ const lldb_private::StringList &SBString
return *m_opaque_ap;
}
-bool SBStringList::IsValid() const { return (m_opaque_ap.get() != NULL); }
+bool SBStringList::IsValid() const { return (m_opaque_ap != NULL); }
void SBStringList::AppendString(const char *str) {
if (str != NULL) {
Modified: lldb/trunk/source/API/SBSymbolContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBSymbolContext.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBSymbolContext.cpp (original)
+++ lldb/trunk/source/API/SBSymbolContext.cpp Thu Dec 20 13:02:55 2018
@@ -27,7 +27,7 @@ SBSymbolContext::SBSymbolContext(const S
SBSymbolContext::SBSymbolContext(const SBSymbolContext &rhs) : m_opaque_ap() {
if (rhs.IsValid()) {
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
*m_opaque_ap = *rhs.m_opaque_ap;
else
ref() = *rhs.m_opaque_ap;
@@ -39,32 +39,31 @@ SBSymbolContext::~SBSymbolContext() {}
const SBSymbolContext &SBSymbolContext::operator=(const SBSymbolContext &rhs) {
if (this != &rhs) {
if (rhs.IsValid())
- m_opaque_ap.reset(
- new lldb_private::SymbolContext(*rhs.m_opaque_ap.get()));
+ m_opaque_ap.reset(new lldb_private::SymbolContext(*rhs.m_opaque_ap));
}
return *this;
}
void SBSymbolContext::SetSymbolContext(const SymbolContext *sc_ptr) {
if (sc_ptr) {
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
*m_opaque_ap = *sc_ptr;
else
m_opaque_ap.reset(new SymbolContext(*sc_ptr));
} else {
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
m_opaque_ap->Clear(true);
}
}
-bool SBSymbolContext::IsValid() const { return m_opaque_ap.get() != NULL; }
+bool SBSymbolContext::IsValid() const { return m_opaque_ap != NULL; }
SBModule SBSymbolContext::GetModule() {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBModule sb_module;
ModuleSP module_sp;
- if (m_opaque_ap.get()) {
+ if (m_opaque_ap) {
module_sp = m_opaque_ap->module_sp;
sb_module.SetSP(module_sp);
}
@@ -81,7 +80,7 @@ SBModule SBSymbolContext::GetModule() {
}
SBCompileUnit SBSymbolContext::GetCompileUnit() {
- return SBCompileUnit(m_opaque_ap.get() ? m_opaque_ap->comp_unit : NULL);
+ return SBCompileUnit(m_opaque_ap ? m_opaque_ap->comp_unit : NULL);
}
SBFunction SBSymbolContext::GetFunction() {
@@ -89,7 +88,7 @@ SBFunction SBSymbolContext::GetFunction(
Function *function = NULL;
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
function = m_opaque_ap->function;
SBFunction sb_function(function);
@@ -103,14 +102,14 @@ SBFunction SBSymbolContext::GetFunction(
}
SBBlock SBSymbolContext::GetBlock() {
- return SBBlock(m_opaque_ap.get() ? m_opaque_ap->block : NULL);
+ return SBBlock(m_opaque_ap ? m_opaque_ap->block : NULL);
}
SBLineEntry SBSymbolContext::GetLineEntry() {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBLineEntry sb_line_entry;
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
sb_line_entry.SetLineEntry(m_opaque_ap->line_entry);
if (log) {
@@ -127,7 +126,7 @@ SBSymbol SBSymbolContext::GetSymbol() {
Symbol *symbol = NULL;
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
symbol = m_opaque_ap->symbol;
SBSymbol sb_symbol(symbol);
@@ -173,19 +172,19 @@ lldb_private::SymbolContext *SBSymbolCon
const lldb_private::SymbolContext &SBSymbolContext::operator*() const {
assert(m_opaque_ap.get());
- return *m_opaque_ap.get();
+ return *m_opaque_ap;
}
lldb_private::SymbolContext &SBSymbolContext::operator*() {
- if (m_opaque_ap.get() == NULL)
+ if (m_opaque_ap == NULL)
m_opaque_ap.reset(new SymbolContext);
- return *m_opaque_ap.get();
+ return *m_opaque_ap;
}
lldb_private::SymbolContext &SBSymbolContext::ref() {
- if (m_opaque_ap.get() == NULL)
+ if (m_opaque_ap == NULL)
m_opaque_ap.reset(new SymbolContext);
- return *m_opaque_ap.get();
+ return *m_opaque_ap;
}
lldb_private::SymbolContext *SBSymbolContext::get() const {
@@ -195,7 +194,7 @@ lldb_private::SymbolContext *SBSymbolCon
bool SBSymbolContext::GetDescription(SBStream &description) {
Stream &strm = description.ref();
- if (m_opaque_ap.get()) {
+ if (m_opaque_ap) {
m_opaque_ap->GetDescription(&strm, lldb::eDescriptionLevelFull, NULL);
} else
strm.PutCString("No value");
Modified: lldb/trunk/source/API/SBSymbolContextList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBSymbolContextList.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBSymbolContextList.cpp (original)
+++ lldb/trunk/source/API/SBSymbolContextList.cpp Thu Dec 20 13:02:55 2018
@@ -31,14 +31,14 @@ operator=(const SBSymbolContextList &rhs
}
uint32_t SBSymbolContextList::GetSize() const {
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
return m_opaque_ap->GetSize();
return 0;
}
SBSymbolContext SBSymbolContextList::GetContextAtIndex(uint32_t idx) {
SBSymbolContext sb_sc;
- if (m_opaque_ap.get()) {
+ if (m_opaque_ap) {
SymbolContext sc;
if (m_opaque_ap->GetContextAtIndex(idx, sc)) {
sb_sc.SetSymbolContext(&sc);
@@ -48,7 +48,7 @@ SBSymbolContext SBSymbolContextList::Get
}
void SBSymbolContextList::Clear() {
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
m_opaque_ap->Clear();
}
@@ -62,7 +62,7 @@ void SBSymbolContextList::Append(SBSymbo
m_opaque_ap->Append(*sc_list);
}
-bool SBSymbolContextList::IsValid() const { return m_opaque_ap.get() != NULL; }
+bool SBSymbolContextList::IsValid() const { return m_opaque_ap != NULL; }
lldb_private::SymbolContextList *SBSymbolContextList::operator->() const {
return m_opaque_ap.get();
@@ -70,12 +70,12 @@ lldb_private::SymbolContextList *SBSymbo
lldb_private::SymbolContextList &SBSymbolContextList::operator*() const {
assert(m_opaque_ap.get());
- return *m_opaque_ap.get();
+ return *m_opaque_ap;
}
bool SBSymbolContextList::GetDescription(lldb::SBStream &description) {
Stream &strm = description.ref();
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
m_opaque_ap->GetDescription(&strm, lldb::eDescriptionLevelFull, NULL);
return true;
}
Modified: lldb/trunk/source/API/SBType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBType.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBType.cpp (original)
+++ lldb/trunk/source/API/SBType.cpp Thu Dec 20 13:02:55 2018
@@ -451,7 +451,7 @@ SBTypeList::SBTypeList(const SBTypeList
Append(const_cast<SBTypeList &>(rhs).GetTypeAtIndex(i));
}
-bool SBTypeList::IsValid() { return (m_opaque_ap.get() != NULL); }
+bool SBTypeList::IsValid() { return (m_opaque_ap != NULL); }
SBTypeList &SBTypeList::operator=(const SBTypeList &rhs) {
if (this != &rhs) {
@@ -469,7 +469,7 @@ void SBTypeList::Append(SBType type) {
}
SBType SBTypeList::GetTypeAtIndex(uint32_t index) {
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
return SBType(m_opaque_ap->GetTypeAtIndex(index));
return SBType();
}
@@ -500,39 +500,39 @@ lldb::SBTypeMember &SBTypeMember::operat
bool SBTypeMember::IsValid() const { return m_opaque_ap.get(); }
const char *SBTypeMember::GetName() {
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
return m_opaque_ap->GetName().GetCString();
return NULL;
}
SBType SBTypeMember::GetType() {
SBType sb_type;
- if (m_opaque_ap.get()) {
+ if (m_opaque_ap) {
sb_type.SetSP(m_opaque_ap->GetTypeImpl());
}
return sb_type;
}
uint64_t SBTypeMember::GetOffsetInBytes() {
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
return m_opaque_ap->GetBitOffset() / 8u;
return 0;
}
uint64_t SBTypeMember::GetOffsetInBits() {
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
return m_opaque_ap->GetBitOffset();
return 0;
}
bool SBTypeMember::IsBitfield() {
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
return m_opaque_ap->GetIsBitfield();
return false;
}
uint32_t SBTypeMember::GetBitfieldSizeInBits() {
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
return m_opaque_ap->GetBitfieldBitSize();
return 0;
}
@@ -541,7 +541,7 @@ bool SBTypeMember::GetDescription(lldb::
lldb::DescriptionLevel description_level) {
Stream &strm = description.ref();
- if (m_opaque_ap.get()) {
+ if (m_opaque_ap) {
const uint32_t bit_offset = m_opaque_ap->GetBitOffset();
const uint32_t byte_offset = bit_offset / 8u;
const uint32_t byte_bit_offset = bit_offset % 8u;
@@ -571,12 +571,12 @@ void SBTypeMember::reset(TypeMemberImpl
}
TypeMemberImpl &SBTypeMember::ref() {
- if (m_opaque_ap.get() == NULL)
+ if (m_opaque_ap == NULL)
m_opaque_ap.reset(new TypeMemberImpl());
- return *m_opaque_ap.get();
+ return *m_opaque_ap;
}
-const TypeMemberImpl &SBTypeMember::ref() const { return *m_opaque_ap.get(); }
+const TypeMemberImpl &SBTypeMember::ref() const { return *m_opaque_ap; }
SBTypeMemberFunction::SBTypeMemberFunction() : m_opaque_sp() {}
Modified: lldb/trunk/source/API/SBTypeEnumMember.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeEnumMember.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBTypeEnumMember.cpp (original)
+++ lldb/trunk/source/API/SBTypeEnumMember.cpp Thu Dec 20 13:02:55 2018
@@ -94,7 +94,7 @@ SBTypeEnumMemberList::SBTypeEnumMemberLi
Append(const_cast<SBTypeEnumMemberList &>(rhs).GetTypeEnumMemberAtIndex(i));
}
-bool SBTypeEnumMemberList::IsValid() { return (m_opaque_ap.get() != NULL); }
+bool SBTypeEnumMemberList::IsValid() { return (m_opaque_ap != NULL); }
SBTypeEnumMemberList &SBTypeEnumMemberList::
operator=(const SBTypeEnumMemberList &rhs) {
@@ -116,7 +116,7 @@ void SBTypeEnumMemberList::Append(SBType
SBTypeEnumMember
SBTypeEnumMemberList::GetTypeEnumMemberAtIndex(uint32_t index) {
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
return SBTypeEnumMember(m_opaque_ap->GetTypeEnumMemberAtIndex(index));
return SBTypeEnumMember();
}
Modified: lldb/trunk/source/API/SBTypeSummary.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeSummary.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBTypeSummary.cpp (original)
+++ lldb/trunk/source/API/SBTypeSummary.cpp Thu Dec 20 13:02:55 2018
@@ -25,7 +25,7 @@ SBTypeSummaryOptions::SBTypeSummaryOptio
SBTypeSummaryOptions::SBTypeSummaryOptions(
const lldb::SBTypeSummaryOptions &rhs) {
if (rhs.m_opaque_ap)
- m_opaque_ap.reset(new TypeSummaryOptions(*rhs.m_opaque_ap.get()));
+ m_opaque_ap.reset(new TypeSummaryOptions(*rhs.m_opaque_ap));
else
m_opaque_ap.reset(new TypeSummaryOptions());
}
@@ -70,11 +70,11 @@ lldb_private::TypeSummaryOptions *SBType
}
lldb_private::TypeSummaryOptions &SBTypeSummaryOptions::ref() {
- return *m_opaque_ap.get();
+ return *m_opaque_ap;
}
const lldb_private::TypeSummaryOptions &SBTypeSummaryOptions::ref() const {
- return *m_opaque_ap.get();
+ return *m_opaque_ap;
}
SBTypeSummaryOptions::SBTypeSummaryOptions(
Modified: lldb/trunk/source/API/SBValueList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBValueList.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBValueList.cpp (original)
+++ lldb/trunk/source/API/SBValueList.cpp Thu Dec 20 13:02:55 2018
@@ -99,7 +99,7 @@ SBValueList::SBValueList(const ValueList
SBValueList::~SBValueList() {}
-bool SBValueList::IsValid() const { return (m_opaque_ap.get() != NULL); }
+bool SBValueList::IsValid() const { return (m_opaque_ap != NULL); }
void SBValueList::Clear() { m_opaque_ap.reset(); }
@@ -150,7 +150,7 @@ SBValue SBValueList::GetValueAtIndex(uin
// idx);
SBValue sb_value;
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
sb_value = m_opaque_ap->GetValueAtIndex(idx);
if (log) {
@@ -172,7 +172,7 @@ uint32_t SBValueList::GetSize() const {
// log->Printf ("SBValueList::GetSize ()");
uint32_t size = 0;
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
size = m_opaque_ap->GetSize();
if (log)
@@ -183,20 +183,20 @@ uint32_t SBValueList::GetSize() const {
}
void SBValueList::CreateIfNeeded() {
- if (m_opaque_ap.get() == NULL)
+ if (m_opaque_ap == NULL)
m_opaque_ap.reset(new ValueListImpl());
}
SBValue SBValueList::FindValueObjectByUID(lldb::user_id_t uid) {
SBValue sb_value;
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
sb_value = m_opaque_ap->FindValueByUID(uid);
return sb_value;
}
SBValue SBValueList::GetFirstValueByName(const char *name) const {
SBValue sb_value;
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
sb_value = m_opaque_ap->GetFirstValueByName(name);
return sb_value;
}
@@ -205,5 +205,5 @@ void *SBValueList::opaque_ptr() { return
ValueListImpl &SBValueList::ref() {
CreateIfNeeded();
- return *m_opaque_ap.get();
+ return *m_opaque_ap;
}
Modified: lldb/trunk/source/API/SBVariablesOptions.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBVariablesOptions.cpp?rev=349821&r1=349820&r2=349821&view=diff
==============================================================================
--- lldb/trunk/source/API/SBVariablesOptions.cpp (original)
+++ lldb/trunk/source/API/SBVariablesOptions.cpp Thu Dec 20 13:02:55 2018
@@ -87,9 +87,7 @@ operator=(const SBVariablesOptions &opti
SBVariablesOptions::~SBVariablesOptions() = default;
-bool SBVariablesOptions::IsValid() const {
- return m_opaque_ap.get() != nullptr;
-}
+bool SBVariablesOptions::IsValid() const { return m_opaque_ap != nullptr; }
bool SBVariablesOptions::GetIncludeArguments() const {
return m_opaque_ap->GetIncludeArguments();
More information about the lldb-commits
mailing list