summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp6
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h12
2 files changed, 13 insertions, 5 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
index d90e12c1465..1ab5e4aa51a 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -378,6 +378,12 @@ PythonList::PythonList(PyInitialValue value)
Reset(PyRefType::Owned, PyList_New(0));
}
+PythonList::PythonList(int list_size)
+ : PythonObject()
+{
+ Reset(PyRefType::Owned, PyList_New(list_size));
+}
+
PythonList::PythonList(PyRefType type, PyObject *py_obj)
: PythonObject()
{
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
index 17ece25c9d3..7d95d576945 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
@@ -215,10 +215,10 @@ class PythonString : public PythonObject
{
public:
PythonString();
- PythonString(PyRefType type, PyObject *o);
- PythonString(const PythonString &object);
explicit PythonString(llvm::StringRef string);
explicit PythonString(const char *string);
+ PythonString(PyRefType type, PyObject *o);
+ PythonString(const PythonString &object);
~PythonString() override;
static bool Check(PyObject *py_obj);
@@ -243,9 +243,9 @@ class PythonInteger : public PythonObject
{
public:
PythonInteger();
+ explicit PythonInteger(int64_t value);
PythonInteger(PyRefType type, PyObject *o);
PythonInteger(const PythonInteger &object);
- explicit PythonInteger(int64_t value);
~PythonInteger() override;
static bool Check(PyObject *py_obj);
@@ -266,7 +266,8 @@ public:
class PythonList : public PythonObject
{
public:
- PythonList(PyInitialValue value);
+ explicit PythonList(PyInitialValue value);
+ explicit PythonList(int list_size);
PythonList(PyRefType type, PyObject *o);
PythonList(const PythonList &list);
~PythonList() override;
@@ -292,7 +293,7 @@ public:
class PythonDictionary : public PythonObject
{
public:
- PythonDictionary(PyInitialValue value);
+ explicit PythonDictionary(PyInitialValue value);
PythonDictionary(PyRefType type, PyObject *o);
PythonDictionary(const PythonDictionary &dict);
~PythonDictionary() override;
@@ -313,6 +314,7 @@ public:
StructuredData::DictionarySP CreateStructuredDictionary() const;
};
+
} // namespace lldb_private
#endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONDATAOBJECTS_H
OpenPOWER on IntegriCloud