blob: 513cbfdad8fcf09307017dc31b9000381d3b0f8d [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
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +030015_opcode_stack_effect_impl(PyObject *module, int opcode, PyObject *oparg);
Serhiy Storchaka1009bf12015-04-03 23:53:51 +030016
17static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +030018_opcode_stack_effect(PyObject *module, PyObject *args)
Serhiy Storchaka1009bf12015-04-03 23:53:51 +030019{
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 Storchaka2954f832016-07-07 18:20:03 +030038/*[clinic end generated code: output=4d91c6a765097853 input=a9049054013a1b77]*/