MCPcopy Create free account
hub / github.com/python/mypy / set_struct_field

Method set_struct_field

mypyc/irbuild/ll_builder.py:347–354  ·  view source on GitHub ↗
(
        self, ptr: Value, struct: RStruct, field: str, value: Value, line: int
    )

Source from the content-addressed store, hash-verified

345 return self.load_mem(address, struct.field_type(field), borrow=borrow)
346
347 def set_struct_field(
348 self, ptr: Value, struct: RStruct, field: str, value: Value, line: int
349 ) -> None:
350 address = self.add(GetElementPtr(ptr, struct, field))
351 field_type = struct.field_type(field)
352 value = self.coerce(value, field_type, line)
353 self.set_mem(address, field_type, value)
354 self.keep_alive([ptr], line)
355
356 def push_error_handler(self, handler: BasicBlock | None) -> None:
357 self.error_handlers.append(handler)

Callers

nothing calls this directly

Calls 6

addMethod · 0.95
coerceMethod · 0.95
set_memMethod · 0.95
keep_aliveMethod · 0.95
GetElementPtrClass · 0.90
field_typeMethod · 0.45

Tested by

no test coverage detected