[Lldb-commits] [lldb] 3350d55 - [lldb/Plugins] Use default initializers for StructuredData::*SP (NFC)
Med Ismail Bennani via lldb-commits
lldb-commits at lists.llvm.org
Thu Nov 3 14:45:29 PDT 2022
Author: Med Ismail Bennani
Date: 2022-11-03T14:44:53-07:00
New Revision: 3350d5574864442d7c4120af25404762a840da00
URL: https://github.com/llvm/llvm-project/commit/3350d5574864442d7c4120af25404762a840da00
DIFF: https://github.com/llvm/llvm-project/commit/3350d5574864442d7c4120af25404762a840da00.diff
LOG: [lldb/Plugins] Use default initializers for StructuredData::*SP (NFC)
This patch replaces the ScriptedProcessInterface getters to return
default initializers for StructureData shared pointers instead of
returning a null pointer.
Differential Revision: https://reviews.llvm.org/D137359
Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>
Added:
Modified:
lldb/include/lldb/Interpreter/ScriptedProcessInterface.h
Removed:
################################################################################
diff --git a/lldb/include/lldb/Interpreter/ScriptedProcessInterface.h b/lldb/include/lldb/Interpreter/ScriptedProcessInterface.h
index 164ec9b9dd605..2795c2f487dff 100644
--- a/lldb/include/lldb/Interpreter/ScriptedProcessInterface.h
+++ b/lldb/include/lldb/Interpreter/ScriptedProcessInterface.h
@@ -24,7 +24,7 @@ class ScriptedProcessInterface : virtual public ScriptedInterface {
CreatePluginObject(llvm::StringRef class_name, ExecutionContext &exe_ctx,
StructuredData::DictionarySP args_sp,
StructuredData::Generic *script_obj = nullptr) override {
- return nullptr;
+ return {};
}
virtual Status Launch() { return Status("ScriptedProcess did not launch"); }
@@ -41,22 +41,22 @@ class ScriptedProcessInterface : virtual public ScriptedInterface {
return {};
}
- virtual StructuredData::DictionarySP GetThreadsInfo() { return nullptr; }
+ virtual StructuredData::DictionarySP GetThreadsInfo() { return {}; }
virtual StructuredData::DictionarySP GetThreadWithID(lldb::tid_t tid) {
- return nullptr;
+ return {};
}
virtual StructuredData::DictionarySP GetRegistersForThread(lldb::tid_t tid) {
- return nullptr;
+ return {};
}
virtual lldb::DataExtractorSP
ReadMemoryAtAddress(lldb::addr_t address, size_t size, Status &error) {
- return nullptr;
+ return {};
}
- virtual StructuredData::ArraySP GetLoadedImages() { return nullptr; }
+ virtual StructuredData::ArraySP GetLoadedImages() { return {}; }
virtual lldb::pid_t GetProcessID() { return LLDB_INVALID_PROCESS_ID; }
@@ -66,12 +66,12 @@ class ScriptedProcessInterface : virtual public ScriptedInterface {
return llvm::None;
}
- virtual StructuredData::DictionarySP GetMetadata() { return nullptr; }
+ virtual StructuredData::DictionarySP GetMetadata() { return {}; }
protected:
friend class ScriptedThread;
virtual lldb::ScriptedThreadInterfaceSP CreateScriptedThreadInterface() {
- return nullptr;
+ return {};
}
};
@@ -81,7 +81,7 @@ class ScriptedThreadInterface : virtual public ScriptedInterface {
CreatePluginObject(llvm::StringRef class_name, ExecutionContext &exe_ctx,
StructuredData::DictionarySP args_sp,
StructuredData::Generic *script_obj = nullptr) override {
- return nullptr;
+ return {};
}
virtual lldb::tid_t GetThreadID() { return LLDB_INVALID_THREAD_ID; }
@@ -92,17 +92,17 @@ class ScriptedThreadInterface : virtual public ScriptedInterface {
virtual llvm::Optional<std::string> GetQueue() { return llvm::None; }
- virtual StructuredData::DictionarySP GetStopReason() { return nullptr; }
+ virtual StructuredData::DictionarySP GetStopReason() { return {}; }
- virtual StructuredData::ArraySP GetStackFrames() { return nullptr; }
+ virtual StructuredData::ArraySP GetStackFrames() { return {}; }
- virtual StructuredData::DictionarySP GetRegisterInfo() { return nullptr; }
+ virtual StructuredData::DictionarySP GetRegisterInfo() { return {}; }
virtual llvm::Optional<std::string> GetRegisterContext() {
return llvm::None;
}
- virtual StructuredData::ArraySP GetExtendedInfo() { return nullptr; }
+ virtual StructuredData::ArraySP GetExtendedInfo() { return {}; }
};
} // namespace lldb_private
More information about the lldb-commits
mailing list