ObjcGlue.getOffset

Returns the offset of the given variable declaration var.

This is used in a DotVarExp to get the offset of the variable the expression is accessing.

Instance variables in Objective-C are non-fragile. That means that the base class can change (add or remove instance variables) without the subclasses needing to recompile or relink. This is implemented instance variables having a dynamic offset. This is achieved by going through an indirection in the form of a symbol generated in the binary. The compiler outputs the static offset in the generated symbol. Then, at load time, the symbol is updated with the correct offset, if necessary.

class ObjcGlue
abstract const
getOffset

Parameters

var VarDeclaration

the variable declaration to return the offset of

type Type

the type of the DotVarExp

offset elem*

the existing offset

Return Value

Type: elem*

a symbol containing the offset of the variable declaration

Meta