Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

GH-103963: Make dis display names of args for intrinsics opcodes #104029

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move static statements to footer and add newline
  • Loading branch information
jkchandalia committed May 2, 2023
commit db9a1e9dec1cb3a1d5dbaf0eaa80ef772a31829c
3 changes: 2 additions & 1 deletion 3 Include/internal/pycore_intrinsics.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
#define INTRINSIC_PREP_RERAISE_STAR 1

#define MAX_INTRINSIC_2 1

typedef PyObject *(*instrinsic_func1)(PyThreadState* tstate, PyObject *value);
typedef PyObject *(*instrinsic_func2)(PyThreadState* tstate, PyObject *value1, PyObject *value2);
extern const instrinsic_func1 _PyIntrinsics_UnaryFunctions[];
extern const instrinsic_func2 _PyIntrinsics_BinaryFunctions[];
extern const instrinsic_func2 _PyIntrinsics_BinaryFunctions[];
19 changes: 8 additions & 11 deletions 19 Tools/build/generate_opcode_h.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@

""".lstrip()

intrinsic_footer = """
typedef PyObject *(*instrinsic_func1)(PyThreadState* tstate, PyObject *value);
typedef PyObject *(*instrinsic_func2)(PyThreadState* tstate, PyObject *value1, PyObject *value2);
extern const instrinsic_func1 _PyIntrinsics_UnaryFunctions[];
extern const instrinsic_func2 _PyIntrinsics_BinaryFunctions[];
"""

DEFINE = "#define {:<38} {:>3}\n"

UINT32_MASK = (1<<32)-1
Expand Down Expand Up @@ -195,17 +202,7 @@ def main(opcode_py, outfile='Include/opcode.h',
nobj.write("\n")
nobj.write(DEFINE.format("MAX_INTRINSIC_2", i))

nobj.write(
"typedef PyObject *(*instrinsic_func1)(PyThreadState* tstate, PyObject *value);"
)
nobj.write("\n")
nobj.write(
"typedef PyObject *(*instrinsic_func2)(PyThreadState* tstate, PyObject *value1, PyObject *value2);"
)
nobj.write("\n")
nobj.write("extern const instrinsic_func1 _PyIntrinsics_UnaryFunctions[];")
nobj.write("\n")
nobj.write("extern const instrinsic_func2 _PyIntrinsics_BinaryFunctions[];")
nobj.write(intrinsic_footer)

fobj.write("\n")
fobj.write("/* Defined in Lib/opcode.py */\n")
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.