[Lldb-commits] [lldb] [lldb] Check for abstract methods implementation in Scripted Plugin Objects (PR #71260)
Alex Langford via lldb-commits
lldb-commits at lists.llvm.org
Fri Nov 3 18:08:52 PDT 2023
================
@@ -32,6 +32,42 @@ class ScriptedPythonInterface : virtual public ScriptedInterface {
ScriptedPythonInterface(ScriptInterpreterPythonImpl &interpreter);
~ScriptedPythonInterface() override = default;
+ enum class AbstractMethodCheckerCases {
+ eNotImplemented,
+ eNotAllocated,
+ eNotCallable,
+ eValid
+ };
+
+ llvm::Expected<std::map<llvm::StringLiteral, AbstractMethodCheckerCases>>
+ CheckAbstractMethodImplementation(
+ const python::PythonDictionary &class_dict) const {
+
+ using namespace python;
+
+ std::map<llvm::StringLiteral, AbstractMethodCheckerCases> checker;
+#define HANDLE_ERROR(method_name, error) \
+ { \
+ checker[method_name] = error; \
+ continue; \
+ }
----------------
bulbazord wrote:
I'm not sure how much value this actually brings to just writing it out below.
If you want to keep it, I recommend making it more obvious that it changes control flow by renaming it. Maybe something like "SET_ERROR_AND_CONTINUE"?
https://github.com/llvm/llvm-project/pull/71260
More information about the lldb-commits
mailing list