summaryrefslogtreecommitdiffstats
path: root/lldb/source/API
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-12-20 21:02:55 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-12-20 21:02:55 +0000
commit3447077a2878b71e0ced355f9a92a815706a0b11 (patch)
tree9568b7fc75bb6345952fa01bc71bda11454d507e /lldb/source/API
parent0a90d7c92b1fa5b7193e7b0e1e0314ab46e76b70 (diff)
downloadbcm5719-llvm-3447077a2878b71e0ced355f9a92a815706a0b11.tar.gz
bcm5719-llvm-3447077a2878b71e0ced355f9a92a815706a0b11.zip
[API] Remove redundants get() from smart pointers. NFC
Removes redundant calls to ::get() from smart pointers in the source/API directory.. llvm-svn: 349821
Diffstat (limited to 'lldb/source/API')
-rw-r--r--lldb/source/API/SBAddress.cpp4
-rw-r--r--lldb/source/API/SBBreakpointName.cpp4
-rw-r--r--lldb/source/API/SBCommandInterpreter.cpp2
-rw-r--r--lldb/source/API/SBCommandReturnObject.cpp4
-rw-r--r--lldb/source/API/SBDeclaration.cpp8
-rw-r--r--lldb/source/API/SBError.cpp20
-rw-r--r--lldb/source/API/SBFileSpec.cpp6
-rw-r--r--lldb/source/API/SBFileSpecList.cpp8
-rw-r--r--lldb/source/API/SBLineEntry.cpp12
-rw-r--r--lldb/source/API/SBMemoryRegionInfoList.cpp2
-rw-r--r--lldb/source/API/SBProcessInfo.cpp4
-rw-r--r--lldb/source/API/SBSourceManager.cpp2
-rw-r--r--lldb/source/API/SBStream.cpp24
-rw-r--r--lldb/source/API/SBStringList.cpp2
-rw-r--r--lldb/source/API/SBSymbolContext.cpp35
-rw-r--r--lldb/source/API/SBSymbolContextList.cpp12
-rw-r--r--lldb/source/API/SBType.cpp24
-rw-r--r--lldb/source/API/SBTypeEnumMember.cpp4
-rw-r--r--lldb/source/API/SBTypeSummary.cpp6
-rw-r--r--lldb/source/API/SBValueList.cpp14
-rw-r--r--lldb/source/API/SBVariablesOptions.cpp4
21 files changed, 97 insertions, 104 deletions
diff --git a/lldb/source/API/SBAddress.cpp b/lldb/source/API/SBAddress.cpp
index 2db447af50f..09ec6c3f10d 100644
--- a/lldb/source/API/SBAddress.cpp
+++ b/lldb/source/API/SBAddress.cpp
@@ -62,7 +62,7 @@ bool lldb::operator==(const SBAddress &lhs, const SBAddress &rhs) {
}
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->() { return m_opaque_ap.get(); }
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;
}
diff --git a/lldb/source/API/SBBreakpointName.cpp b/lldb/source/API/SBBreakpointName.cpp
index 34e0a30e134..47bddd75234 100644
--- a/lldb/source/API/SBBreakpointName.cpp
+++ b/lldb/source/API/SBBreakpointName.cpp
@@ -164,11 +164,11 @@ const SBBreakpointName &SBBreakpointName::operator=(const SBBreakpointName &rhs)
}
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 {
diff --git a/lldb/source/API/SBCommandInterpreter.cpp b/lldb/source/API/SBCommandInterpreter.cpp
index a4a9a2ae748..2a06e608c0b 100644
--- a/lldb/source/API/SBCommandInterpreter.cpp
+++ b/lldb/source/API/SBCommandInterpreter.cpp
@@ -98,7 +98,7 @@ SBCommandInterpreterRunOptions::get() const {
lldb_private::CommandInterpreterRunOptions &
SBCommandInterpreterRunOptions::ref() const {
- return *m_opaque_up.get();
+ return *m_opaque_up;
}
class CommandPluginInterfaceImplementation : public CommandObjectParsed {
diff --git a/lldb/source/API/SBCommandReturnObject.cpp b/lldb/source/API/SBCommandReturnObject.cpp
index 157f3209ecc..7bc02985a3e 100644
--- a/lldb/source/API/SBCommandReturnObject.cpp
+++ b/lldb/source/API/SBCommandReturnObject.cpp
@@ -48,9 +48,7 @@ operator=(const SBCommandReturnObject &rhs) {
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));
diff --git a/lldb/source/API/SBDeclaration.cpp b/lldb/source/API/SBDeclaration.cpp
index d6e61e32582..90e4db367d2 100644
--- a/lldb/source/API/SBDeclaration.cpp
+++ b/lldb/source/API/SBDeclaration.cpp
@@ -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 *SBDeclaration::operator->() const {
}
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 &SBDeclaration::ref() const {
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());
diff --git a/lldb/source/API/SBError.cpp b/lldb/source/API/SBError.cpp
index b2811d0ac38..04433bb1aab 100644
--- a/lldb/source/API/SBError.cpp
+++ b/lldb/source/API/SBError.cpp
@@ -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 SBError &rhs) {
}
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(const char *format, ...) {
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::operator*() const {
}
bool SBError::GetDescription(SBStream &description) {
- if (m_opaque_ap.get()) {
+ if (m_opaque_ap) {
if (m_opaque_ap->Success())
description.Printf("success");
else {
diff --git a/lldb/source/API/SBFileSpec.cpp b/lldb/source/API/SBFileSpec.cpp
index 9fedeecaf7c..f136409d0b6 100644
--- a/lldb/source/API/SBFileSpec.cpp
+++ b/lldb/source/API/SBFileSpec.cpp
@@ -148,12 +148,10 @@ const lldb_private::FileSpec *SBFileSpec::get() const {
}
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;
diff --git a/lldb/source/API/SBFileSpecList.cpp b/lldb/source/API/SBFileSpecList.cpp
index 67d28dcbe11..439859c3fd8 100644
--- a/lldb/source/API/SBFileSpecList.cpp
+++ b/lldb/source/API/SBFileSpecList.cpp
@@ -26,7 +26,7 @@ SBFileSpecList::SBFileSpecList() : m_opaque_ap(new FileSpecList()) {}
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 *SBFileSpecList::get() const {
}
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++) {
diff --git a/lldb/source/API/SBLineEntry.cpp b/lldb/source/API/SBLineEntry.cpp
index 7341d3603df..6f59fe3407e 100644
--- a/lldb/source/API/SBLineEntry.cpp
+++ b/lldb/source/API/SBLineEntry.cpp
@@ -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() const {
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 *SBLineEntry::operator->() const {
}
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 &SBLineEntry::ref() const { return *m_opaque_ap; }
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());
diff --git a/lldb/source/API/SBMemoryRegionInfoList.cpp b/lldb/source/API/SBMemoryRegionInfoList.cpp
index 00e2965510e..1cefc9dcc04 100644
--- a/lldb/source/API/SBMemoryRegionInfoList.cpp
+++ b/lldb/source/API/SBMemoryRegionInfoList.cpp
@@ -129,5 +129,5 @@ const MemoryRegionInfoListImpl *SBMemoryRegionInfoList::operator->() const {
const MemoryRegionInfoListImpl &SBMemoryRegionInfoList::operator*() const {
assert(m_opaque_ap.get());
- return *m_opaque_ap.get();
+ return *m_opaque_ap;
}
diff --git a/lldb/source/API/SBProcessInfo.cpp b/lldb/source/API/SBProcessInfo.cpp
index 38f6c1d1e69..2b3ebfb2465 100644
--- a/lldb/source/API/SBProcessInfo.cpp
+++ b/lldb/source/API/SBProcessInfo.cpp
@@ -36,7 +36,7 @@ SBProcessInfo &SBProcessInfo::operator=(const SBProcessInfo &rhs) {
}
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 ProcessInstanceInfo &proc_info_ref) {
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;
diff --git a/lldb/source/API/SBSourceManager.cpp b/lldb/source/API/SBSourceManager.cpp
index 5804c22bacb..1d47cc034e3 100644
--- a/lldb/source/API/SBSourceManager.cpp
+++ b/lldb/source/API/SBSourceManager.cpp
@@ -107,7 +107,7 @@ size_t SBSourceManager::DisplaySourceLinesWithLineNumbersAndColumn(
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(
diff --git a/lldb/source/API/SBStream.cpp b/lldb/source/API/SBStream.cpp
index 5dea4595910..876ef02170d 100644
--- a/lldb/source/API/SBStream.cpp
+++ b/lldb/source/API/SBStream.cpp
@@ -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 *path, bool append) {
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 *path, bool append) {
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 *fh, bool transfer_fh_ownership) {
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 *fh, bool transfer_fh_ownership) {
}
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 *fh, bool transfer_fh_ownership) {
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(int fd, bool transfer_fh_ownership) {
}
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->() { return m_opaque_ap.get(); }
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)
diff --git a/lldb/source/API/SBStringList.cpp b/lldb/source/API/SBStringList.cpp
index 9ac69b15ebb..6ed4d4b7fb8 100644
--- a/lldb/source/API/SBStringList.cpp
+++ b/lldb/source/API/SBStringList.cpp
@@ -47,7 +47,7 @@ const lldb_private::StringList &SBStringList::operator*() const {
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) {
diff --git a/lldb/source/API/SBSymbolContext.cpp b/lldb/source/API/SBSymbolContext.cpp
index 45dfffd916e..ab70c6f6ca6 100644
--- a/lldb/source/API/SBSymbolContext.cpp
+++ b/lldb/source/API/SBSymbolContext.cpp
@@ -27,7 +27,7 @@ SBSymbolContext::SBSymbolContext(const SymbolContext *sc_ptr) : m_opaque_ap() {
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 *SBSymbolContext::operator->() const {
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 *SBSymbolContext::get() const {
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");
diff --git a/lldb/source/API/SBSymbolContextList.cpp b/lldb/source/API/SBSymbolContextList.cpp
index 8cc29c3422d..b07ab2afd55 100644
--- a/lldb/source/API/SBSymbolContextList.cpp
+++ b/lldb/source/API/SBSymbolContextList.cpp
@@ -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::GetContextAtIndex(uint32_t idx) {
}
void SBSymbolContextList::Clear() {
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
m_opaque_ap->Clear();
}
@@ -62,7 +62,7 @@ void SBSymbolContextList::Append(SBSymbolContextList &sc_list) {
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 *SBSymbolContextList::operator->() const {
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;
}
diff --git a/lldb/source/API/SBType.cpp b/lldb/source/API/SBType.cpp
index 7af27095e68..8cfa9fd37c7 100644
--- a/lldb/source/API/SBType.cpp
+++ b/lldb/source/API/SBType.cpp
@@ -451,7 +451,7 @@ SBTypeList::SBTypeList(const SBTypeList &rhs)
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::operator=(const lldb::SBTypeMember &rhs) {
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::SBStream &description,
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 *type_member_impl) {
}
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() {}
diff --git a/lldb/source/API/SBTypeEnumMember.cpp b/lldb/source/API/SBTypeEnumMember.cpp
index 5ca9db7ce24..87be40e8b14 100644
--- a/lldb/source/API/SBTypeEnumMember.cpp
+++ b/lldb/source/API/SBTypeEnumMember.cpp
@@ -94,7 +94,7 @@ SBTypeEnumMemberList::SBTypeEnumMemberList(const SBTypeEnumMemberList &rhs)
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(SBTypeEnumMember enum_member) {
SBTypeEnumMember
SBTypeEnumMemberList::GetTypeEnumMemberAtIndex(uint32_t index) {
- if (m_opaque_ap.get())
+ if (m_opaque_ap)
return SBTypeEnumMember(m_opaque_ap->GetTypeEnumMemberAtIndex(index));
return SBTypeEnumMember();
}
diff --git a/lldb/source/API/SBTypeSummary.cpp b/lldb/source/API/SBTypeSummary.cpp
index 314c7119321..76c94ae8344 100644
--- a/lldb/source/API/SBTypeSummary.cpp
+++ b/lldb/source/API/SBTypeSummary.cpp
@@ -25,7 +25,7 @@ SBTypeSummaryOptions::SBTypeSummaryOptions() {
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 *SBTypeSummaryOptions::get() {
}
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(
diff --git a/lldb/source/API/SBValueList.cpp b/lldb/source/API/SBValueList.cpp
index 0adf3bb914a..82b464bab9b 100644
--- a/lldb/source/API/SBValueList.cpp
+++ b/lldb/source/API/SBValueList.cpp
@@ -99,7 +99,7 @@ SBValueList::SBValueList(const ValueListImpl *lldb_object_ptr) : m_opaque_ap() {
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(uint32_t idx) const {
// 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 m_opaque_ap.get(); }
ValueListImpl &SBValueList::ref() {
CreateIfNeeded();
- return *m_opaque_ap.get();
+ return *m_opaque_ap;
}
diff --git a/lldb/source/API/SBVariablesOptions.cpp b/lldb/source/API/SBVariablesOptions.cpp
index ae069756de1..1db8fc31f1e 100644
--- a/lldb/source/API/SBVariablesOptions.cpp
+++ b/lldb/source/API/SBVariablesOptions.cpp
@@ -87,9 +87,7 @@ operator=(const SBVariablesOptions &options) {
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();
OpenPOWER on IntegriCloud