Lines Matching refs:PythonObject

41 void PythonObject::Dump(Stream &strm) const {  in Dump()
61 PyObjectType PythonObject::GetObjectType() const { in GetObjectType()
90 PythonString PythonObject::Repr() const { in Repr()
99 PythonString PythonObject::Str() const { in Str()
108 PythonObject
109 PythonObject::ResolveNameWithDictionary(llvm::StringRef name, in ResolveNameWithDictionary()
113 PythonObject result = dict.GetItemForKey(PythonString(piece)); in ResolveNameWithDictionary()
124 PythonObject PythonObject::ResolveName(llvm::StringRef name) const { in ResolveName()
144 PythonObject parent = ResolveName(name.substr(0, dot_pos)); in ResolveName()
146 return PythonObject(); in ResolveName()
152 bool PythonObject::HasAttribute(llvm::StringRef attr) const { in HasAttribute()
159 PythonObject PythonObject::GetAttributeValue(llvm::StringRef attr) const { in GetAttributeValue()
161 return PythonObject(); in GetAttributeValue()
165 return PythonObject(); in GetAttributeValue()
167 return PythonObject(PyRefType::Owned, in GetAttributeValue()
171 bool PythonObject::IsNone() const { return m_py_obj == Py_None; } in IsNone()
173 bool PythonObject::IsValid() const { return m_py_obj != nullptr; } in IsValid()
175 bool PythonObject::IsAllocated() const { return IsValid() && !IsNone(); } in IsAllocated()
177 StructuredData::ObjectSP PythonObject::CreateStructuredObject() const { in CreateStructuredObject()
204 PythonBytes::PythonBytes() : PythonObject() {} in PythonBytes()
206 PythonBytes::PythonBytes(llvm::ArrayRef<uint8_t> bytes) : PythonObject() { in PythonBytes()
210 PythonBytes::PythonBytes(const uint8_t *bytes, size_t length) : PythonObject() { in PythonBytes()
214 PythonBytes::PythonBytes(PyRefType type, PyObject *py_obj) : PythonObject() { in PythonBytes()
218 PythonBytes::PythonBytes(const PythonBytes &object) : PythonObject(object) {} in PythonBytes()
231 PythonObject result(type, py_obj); in Reset()
234 PythonObject::Reset(); in Reset()
240 PythonObject::Reset(PyRefType::Borrowed, result.get()); in Reset()
263 PythonObject::Reset(PyRefType::Owned, py_bytes); in SetBytes()
288 : PythonObject(object) {} in PythonByteArray()
301 PythonObject result(type, py_obj); in Reset()
304 PythonObject::Reset(); in Reset()
310 PythonObject::Reset(PyRefType::Borrowed, result.get()); in Reset()
341 PythonString::PythonString(PyRefType type, PyObject *py_obj) : PythonObject() { in PythonString()
345 PythonString::PythonString(const PythonString &object) : PythonObject(object) {} in PythonString()
347 PythonString::PythonString(llvm::StringRef string) : PythonObject() { in PythonString()
351 PythonString::PythonString(const char *string) : PythonObject() { in PythonString()
355 PythonString::PythonString() : PythonObject() {} in PythonString()
375 PythonObject result(type, py_obj); in Reset()
378 PythonObject::Reset(); in Reset()
390 PythonObject::Reset(PyRefType::Borrowed, result.get()); in Reset()
424 PythonObject::Reset(PyRefType::Owned, unicode); in SetString()
427 PythonObject::Reset(PyRefType::Owned, str); in SetString()
441 PythonInteger::PythonInteger() : PythonObject() {} in PythonInteger()
444 : PythonObject() { in PythonInteger()
449 : PythonObject(object) {} in PythonInteger()
451 PythonInteger::PythonInteger(int64_t value) : PythonObject() { in PythonInteger()
473 PythonObject result(type, py_obj); in Reset()
476 PythonObject::Reset(); in Reset()
497 PythonObject::Reset(PyRefType::Borrowed, result.get()); in Reset()
520 PythonObject::Reset(PyRefType::Owned, PyLong_FromLongLong(value)); in SetInteger()
533 PythonList::PythonList(PyInitialValue value) : PythonObject() { in PythonList()
538 PythonList::PythonList(int list_size) : PythonObject() { in PythonList()
542 PythonList::PythonList(PyRefType type, PyObject *py_obj) : PythonObject() { in PythonList()
546 PythonList::PythonList(const PythonList &list) : PythonObject(list) {} in PythonList()
559 PythonObject result(type, py_obj); in Reset()
562 PythonObject::Reset(); in Reset()
568 PythonObject::Reset(PyRefType::Borrowed, result.get()); in Reset()
577 PythonObject PythonList::GetItemAtIndex(uint32_t index) const { in GetItemAtIndex()
579 return PythonObject(PyRefType::Borrowed, PyList_GetItem(m_py_obj, index)); in GetItemAtIndex()
580 return PythonObject(); in GetItemAtIndex()
583 void PythonList::SetItemAtIndex(uint32_t index, const PythonObject &object) { in SetItemAtIndex()
592 void PythonList::AppendItem(const PythonObject &object) { in AppendItem()
604 PythonObject obj = GetItemAtIndex(i); in CreateStructuredArray()
614 PythonTuple::PythonTuple(PyInitialValue value) : PythonObject() { in PythonTuple()
619 PythonTuple::PythonTuple(int tuple_size) : PythonObject() { in PythonTuple()
623 PythonTuple::PythonTuple(PyRefType type, PyObject *py_obj) : PythonObject() { in PythonTuple()
627 PythonTuple::PythonTuple(const PythonTuple &tuple) : PythonObject(tuple) {} in PythonTuple()
629 PythonTuple::PythonTuple(std::initializer_list<PythonObject> objects) { in PythonTuple()
645 PythonObject object(PyRefType::Borrowed, py_object); in PythonTuple()
663 PythonObject result(type, py_obj); in Reset()
666 PythonObject::Reset(); in Reset()
672 PythonObject::Reset(PyRefType::Borrowed, result.get()); in Reset()
681 PythonObject PythonTuple::GetItemAtIndex(uint32_t index) const { in GetItemAtIndex()
683 return PythonObject(PyRefType::Borrowed, PyTuple_GetItem(m_py_obj, index)); in GetItemAtIndex()
684 return PythonObject(); in GetItemAtIndex()
687 void PythonTuple::SetItemAtIndex(uint32_t index, const PythonObject &object) { in SetItemAtIndex()
700 PythonObject obj = GetItemAtIndex(i); in CreateStructuredArray()
710 PythonDictionary::PythonDictionary(PyInitialValue value) : PythonObject() { in PythonDictionary()
716 : PythonObject() { in PythonDictionary()
721 : PythonObject(object) {} in PythonDictionary()
735 PythonObject result(type, py_obj); in Reset()
738 PythonObject::Reset(); in Reset()
744 PythonObject::Reset(PyRefType::Borrowed, result.get()); in Reset()
759 PythonObject PythonDictionary::GetItemForKey(const PythonObject &key) const { in GetItemForKey()
761 return PythonObject(PyRefType::Borrowed, in GetItemForKey()
763 return PythonObject(); in GetItemForKey()
766 void PythonDictionary::SetItemForKey(const PythonObject &key, in SetItemForKey()
767 const PythonObject &value) { in SetItemForKey()
778 PythonObject key = keys.GetItemAtIndex(i); in CreateStructuredDictionary()
779 PythonObject value = GetItemForKey(key); in CreateStructuredDictionary()
786 PythonModule::PythonModule() : PythonObject() {} in PythonModule()
792 PythonModule::PythonModule(const PythonModule &dict) : PythonObject(dict) {} in PythonModule()
826 PythonObject result(type, py_obj); in Reset()
829 PythonObject::Reset(); in Reset()
835 PythonObject::Reset(PyRefType::Borrowed, result.get()); in Reset()
842 PythonCallable::PythonCallable() : PythonObject() {} in PythonCallable()
849 : PythonObject(callable) {} in PythonCallable()
863 PythonObject result(type, py_obj); in Reset()
866 PythonObject::Reset(); in Reset()
872 PythonObject::Reset(PyRefType::Borrowed, result.get()); in Reset()
883 PythonObject im_self = GetAttributeValue("im_self"); in GetNumArguments()
889 PythonObject __call__ = GetAttributeValue("__call__"); in GetNumArguments()
894 PythonObject im_self = GetAttributeValue("im_self"); in GetNumArguments()
915 PythonObject PythonCallable::operator()() { in operator ()()
916 return PythonObject(PyRefType::Owned, PyObject_CallObject(m_py_obj, nullptr)); in operator ()()
919 PythonObject PythonCallable::
922 return PythonObject(PyRefType::Owned, in operator ()()
926 PythonObject PythonCallable::
927 operator()(std::initializer_list<PythonObject> args) { in operator ()()
929 return PythonObject(PyRefType::Owned, in operator ()()
933 PythonFile::PythonFile() : PythonObject() {} in PythonFile()
958 PythonObject io_module(PyRefType::Owned, PyImport_ImportModule("io")); in Check()
961 PythonObject io_base_class = io_dict.GetItemForKey(PythonString("IOBase")); in Check()
963 PythonObject object_type(PyRefType::Owned, PyObject_Type(py_obj)); in Check()
977 PythonObject result(type, py_obj); in Reset()
980 PythonObject::Reset(); in Reset()
986 PythonObject::Reset(PyRefType::Borrowed, result.get()); in Reset()