Skip to content

Commit

Permalink
Add visibility slot to Symbol model (#103)
Browse files Browse the repository at this point in the history
In preparation for the visibility-based selective flagging of CPython
symbols marked as `static inline`.
  • Loading branch information
nicholasjng authored Apr 9, 2024
1 parent 67509df commit a492068
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions abi3info/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
from dataclasses import dataclass
from typing import Literal, Union

# values taken from the GCC/Clang manual.
Visibility = Literal["default", "hidden", "internal", "protected"]


@dataclass(frozen=True, eq=False, unsafe_hash=True)
class Symbol:
Expand All @@ -24,6 +27,11 @@ class Symbol:
The symbol's underlying name. This may not correspond to an actual symbol
in a binary without platform-specific normalization.
"""
visibility: Visibility | None = None
"""
The symbol's visibility in the shared object file, or None if it could not
be determined.
"""

@property
def macos(self) -> str:
Expand Down

0 comments on commit a492068

Please sign in to comment.