================
@@ -32,6 +32,84 @@ class ScriptedPythonInterface : virtual public
ScriptedInterface {
ScriptedPythonInterface(ScriptInterpreterPythonImpl &interpreter);
~ScriptedPythonInterface() override = default;
+ template <typename... Args>
+ llvm::Expected<StructuredData::GenericSP>
+ CreatePluginObject(llvm::StringRef class_name,
+ StructuredData::Generic *script_obj, Args... args) {
+ using namespace python;
+ using Locker = ScriptInterpreterPythonImpl::Locker;
+
+ std::string error_string;
+ if (class_name.empty() &&
+ llvm::StringRef(m_interpreter.GetDictionaryName()).empty() &&
+ !script_obj)
+ return llvm::createStringError(
+ llvm::inconvertibleErrorCode(),
+ "ScriptedPythonInterface::CreatePluginObject - missing script class "
+ "name, dictionary or object.");
----------------
JDevlieghere wrote:
Can we make these 3 separate errors? We know which ones are missing.
Alternatively, you could make them bools and conditionally include the "name",
"dictionary" and "object" substrings based on that.
https://github.com/llvm/llvm-project/pull/68052
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits