summaryrefslogtreecommitdiffstats
path: root/Modules/_testinternalcapi.c
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2024-04-17 15:42:04 (GMT)
committerGitHub <noreply@github.com>2024-04-17 15:42:04 (GMT)
commitc179c0e6cbb4d1e981fffd43f207f5b1aa5388e5 (patch)
tree4600115b3e61e7404b550d81a23a235d31c183fb /Modules/_testinternalcapi.c
parentae8dfd2761e4a45afe0adada0f91f371dd121bb8 (diff)
downloadcpython-c179c0e6cbb4d1e981fffd43f207f5b1aa5388e5.zip
cpython-c179c0e6cbb4d1e981fffd43f207f5b1aa5388e5.tar.gz
cpython-c179c0e6cbb4d1e981fffd43f207f5b1aa5388e5.tar.bz2
gh-117680: make _PyInstructionSequence a PyObject and use it in tests (#117629)
Diffstat (limited to 'Modules/_testinternalcapi.c')
-rw-r--r--Modules/_testinternalcapi.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c
index 36dad02..cc9e140 100644
--- a/Modules/_testinternalcapi.c
+++ b/Modules/_testinternalcapi.c
@@ -22,6 +22,7 @@
#include "pycore_gc.h" // PyGC_Head
#include "pycore_hashtable.h" // _Py_hashtable_new()
#include "pycore_initconfig.h" // _Py_GetConfigsAsDict()
+#include "pycore_instruction_sequence.h" // _PyInstructionSequence_New()
#include "pycore_interp.h" // _PyInterpreterState_GetConfigCopy()
#include "pycore_long.h" // _PyLong_Sign()
#include "pycore_object.h" // _PyObject_IsFreed()
@@ -723,6 +724,19 @@ _testinternalcapi_compiler_cleandoc_impl(PyObject *module, PyObject *doc)
return _PyCompile_CleanDoc(doc);
}
+/*[clinic input]
+
+_testinternalcapi.new_instruction_sequence -> object
+
+Return a new, empty InstructionSequence.
+[clinic start generated code]*/
+
+static PyObject *
+_testinternalcapi_new_instruction_sequence_impl(PyObject *module)
+/*[clinic end generated code: output=ea4243fddb9057fd input=1dec2591b173be83]*/
+{
+ return _PyInstructionSequence_New();
+}
/*[clinic input]
@@ -1952,6 +1966,7 @@ static PyMethodDef module_functions[] = {
{"set_eval_frame_default", set_eval_frame_default, METH_NOARGS, NULL},
{"set_eval_frame_record", set_eval_frame_record, METH_O, NULL},
_TESTINTERNALCAPI_COMPILER_CLEANDOC_METHODDEF
+ _TESTINTERNALCAPI_NEW_INSTRUCTION_SEQUENCE_METHODDEF
_TESTINTERNALCAPI_COMPILER_CODEGEN_METHODDEF
_TESTINTERNALCAPI_OPTIMIZE_CFG_METHODDEF
_TESTINTERNALCAPI_ASSEMBLE_CODE_OBJECT_METHODDEF