spack/var/spack/repos/builtin/packages/llvm/llvm_py37.patch
Brian Homerding 5e20bd86e4 Convert llvm Spackage to use the monorepo (#11392)
* [WIP] Convert llvm spackage to use the monorepo

* Correcting python dependencies

* Adding develop version for llvm monorepo

* Python 2.6 Fix

* Build Flang fork in a different root_cmakelists_dir

* Formatting Fix

* Including flang package changes

* Removing explicit llvm dependencies variants

* flake8 fix

* Updating patches and llvm+flang logic

* Updating env setup API

* Add top level git

* Conflicting flang variant with other variants
2019-12-06 12:01:30 -06:00

38 lines
1.2 KiB
Diff

From ecdefed7f6ba11421fe1ecc6c13a135ab7bcda73 Mon Sep 17 00:00:00 2001
From: Pavel Labath <labath@google.com>
Date: Mon, 23 Jul 2018 11:37:36 +0100
Subject: [PATCH] Fix PythonString::GetString for >=python-3.7
The return value of PyUnicode_AsUTF8AndSize is now "const char *".
---
.../Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/tools/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
index 6a9d57d5a..94f16b2c7 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -404,14 +404,16 @@ llvm::StringRef PythonString::GetString() const {
return llvm::StringRef();
Py_ssize_t size;
- char *c;
+ const char *data;
#if PY_MAJOR_VERSION >= 3
- c = PyUnicode_AsUTF8AndSize(m_py_obj, &size);
+ data = PyUnicode_AsUTF8AndSize(m_py_obj, &size);
#else
+ char *c;
PyString_AsStringAndSize(m_py_obj, &c, &size);
+ data = c;
#endif
- return llvm::StringRef(c, size);
+ return llvm::StringRef(data, size);
}
size_t PythonString::GetSize() const {
--
2.18.0.233.g985f88cf7e-goog