blob: 196a2eefd374abfb4368482e24fe6934098ff1d7 [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 Storchaka1009bf12015-04-03 23:53:51 +030026 &opcode, &oparg))
27 goto exit;
28 _return_value = _opcode_stack_effect_impl(module, opcode, oparg);
29 if ((_return_value == -1) && PyErr_Occurred())
30 goto exit;
31 return_value = PyLong_FromLong((long)_return_value);
32
33exit:
34 return return_value;
35}
Serhiy Storchaka247789c2015-04-24 00:40:51 +030036/*[clinic end generated code: output=8ee7cb735705e8b3 input=a9049054013a1b77]*/