Skip to content

Commit

Permalink
[lldb/Python] Unify PythonFormat & GetPythonValueFormatString (NFC)
Browse files Browse the repository at this point in the history
This patch removes all occurences to GetPythonValueFormatString and
use the template specialization of PythonFormat structs instead.

Differential Revision: https://reviews.llvm.org/D134033

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
  • Loading branch information
medismailben committed Nov 18, 2022
1 parent 7e01924 commit 27a26e7
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ add_lldb_library(lldbPluginScriptInterpreterPython PLUGIN
ScriptedPythonInterface.cpp
ScriptedProcessPythonInterface.cpp
ScriptedThreadPythonInterface.cpp
SWIGPythonBridge.cpp

LINK_LIBS
lldbBreakpoint
Expand Down
48 changes: 0 additions & 48 deletions lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.cpp

This file was deleted.

21 changes: 0 additions & 21 deletions lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,27 +86,6 @@ python::ScopedPythonObject<lldb::SBEvent> ToSWIGWrapper(Event *event);

} // namespace python

// GetPythonValueFormatString provides a system independent type safe way to
// convert a variable's type into a python value format. Python value formats
// are defined in terms of builtin C types and could change from system to as
// the underlying typedef for uint* types, size_t, off_t and other values
// change.

template <typename T> const char *GetPythonValueFormatString(T t);
template <> const char *GetPythonValueFormatString(char *);
template <> const char *GetPythonValueFormatString(char);
template <> const char *GetPythonValueFormatString(unsigned char);
template <> const char *GetPythonValueFormatString(short);
template <> const char *GetPythonValueFormatString(unsigned short);
template <> const char *GetPythonValueFormatString(int);
template <> const char *GetPythonValueFormatString(unsigned int);
template <> const char *GetPythonValueFormatString(long);
template <> const char *GetPythonValueFormatString(unsigned long);
template <> const char *GetPythonValueFormatString(long long);
template <> const char *GetPythonValueFormatString(unsigned long long);
template <> const char *GetPythonValueFormatString(float t);
template <> const char *GetPythonValueFormatString(double t);

void *LLDBSWIGPython_CastPyObjectToSBData(PyObject *data);
void *LLDBSWIGPython_CastPyObjectToSBError(PyObject *data);
void *LLDBSWIGPython_CastPyObjectToSBValue(PyObject *data);
Expand Down

0 comments on commit 27a26e7

Please sign in to comment.