Skip to content

gh-118771: Ensure names defined in optimizer.h start with Py/_Py#118825

Merged
encukou merged 4 commits intopython:mainfrom
encukou:private
May 10, 2024
Merged

gh-118771: Ensure names defined in optimizer.h start with Py/_Py#118825
encukou merged 4 commits intopython:mainfrom
encukou:private

Conversation

@encukou
Copy link
Member

@encukou encukou commented May 9, 2024

optimizer.h is included from Python.h, and defines some names that can clash with user code. They should be hidden or get the Py/_Py prefix.

This PR:

  • removes unused struct tags from typedefs:
    • struct _bloom_filter
    • struct _exit_data
  • prefixes the remaining names with _Py_:
    • uop_get_target
    • uop_get_exit_index
    • uop_get_jump_target
    • uop_get_error_target
    • optimize_func typedef
    • BLOOM_FILTER_WORDS
    • UOP_FORMAT_TARGET
    • UOP_FORMAT_EXIT
    • UOP_FORMAT_JUMP
    • UOP_FORMAT_UNUSED

Perhaps some of these should be in a private header instead?
Or perhaps some should be public?
@markshannon, could you clarify the intent here?

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants