Load a static name (name :: static). Load a C static variable/pointer. The namespace for statics is shared for the entire compilation group. You can optionally provide a module name and a sub-namespace identifier for additional namespacing to avoid name conflicts. The static namespa
| 973 | |
| 974 | @final |
| 975 | class LoadStatic(RegisterOp): |
| 976 | """Load a static name (name :: static). |
| 977 | |
| 978 | Load a C static variable/pointer. The namespace for statics is shared |
| 979 | for the entire compilation group. You can optionally provide a module |
| 980 | name and a sub-namespace identifier for additional namespacing to avoid |
| 981 | name conflicts. The static namespace does not overlap with other C names, |
| 982 | since the final C name will get a prefix, so conflicts only must be |
| 983 | avoided with other statics. |
| 984 | """ |
| 985 | |
| 986 | error_kind = ERR_NEVER |
| 987 | is_borrowed = True |
| 988 | |
| 989 | def __init__( |
| 990 | self, |
| 991 | type: RType, |
| 992 | identifier: str, |
| 993 | module_name: str | None = None, |
| 994 | namespace: str = NAMESPACE_STATIC, |
| 995 | line: int = -1, |
| 996 | ann: object = None, |
| 997 | ) -> None: |
| 998 | super().__init__(line) |
| 999 | self.identifier = identifier |
| 1000 | self.module_name = module_name |
| 1001 | self.namespace = namespace |
| 1002 | self.type = type |
| 1003 | self.ann = ann # An object to pretty print with the load |
| 1004 | |
| 1005 | def sources(self) -> list[Value]: |
| 1006 | return [] |
| 1007 | |
| 1008 | def set_sources(self, new: list[Value]) -> None: |
| 1009 | assert not new |
| 1010 | |
| 1011 | def accept(self, visitor: OpVisitor[T]) -> T: |
| 1012 | return visitor.visit_load_static(self) |
| 1013 | |
| 1014 | |
| 1015 | @final |
no outgoing calls
no test coverage detected
searching dependent graphs…