blob: 68652b0388434f7968fd9db009048133edbd9a4e [file] [log] [blame]
Serhiy Storchaka1009bf12015-04-03 23:53:51 +03001/*[clinic input]
2preserve
3[clinic start generated code]*/
4
5PyDoc_STRVAR(_opcode_stack_effect__doc__,
6"stack_effect($module, opcode, oparg=None, /)\n"
7"--\n"
8"\n"
9"Compute the stack effect of the opcode.");
10
11#define _OPCODE_STACK_EFFECT_METHODDEF \
12 {"stack_effect", (PyCFunction)_opcode_stack_effect, METH_VARARGS, _opcode_stack_effect__doc__},
13
14static int
15_opcode_stack_effect_impl(PyModuleDef *module, int opcode, PyObject *oparg);
16
17static PyObject *
18_opcode_stack_effect(PyModuleDef *module, PyObject *args)
19{
20 PyObject *return_value = NULL;
21 int opcode;
22 PyObject *oparg = Py_None;
23 int _return_value;
24
Serhiy Storchaka247789c2015-04-24 00:40:51 +030025 if (!PyArg_ParseTuple(args, "i|O:stack_effect",
Serhiy Storchaka5dee6552016-06-09 16:16:06 +030026 &opcode, &oparg)) {
Serhiy Storchaka1009bf12015-04-03 23:53:51 +030027 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +030028 }
Serhiy Storchaka1009bf12015-04-03 23:53:51 +030029 _return_value = _opcode_stack_effect_impl(module, opcode, oparg);
Serhiy Storchaka5dee6552016-06-09 16:16:06 +030030 if ((_return_value == -1) && PyErr_Occurred()) {
Serhiy Storchaka1009bf12015-04-03 23:53:51 +030031 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +030032 }
Serhiy Storchaka1009bf12015-04-03 23:53:51 +030033 return_value = PyLong_FromLong((long)_return_value);
34
35exit:
36 return return_value;
37}
Serhiy Storchaka5dee6552016-06-09 16:16:06 +030038/*[clinic end generated code: output=5bd7c1c113e6526a input=a9049054013a1b77]*/