fn getfield_on_symbol(expr: &Expr, sym: &Symbol) -> Option<u32> {
    if let GetField {
        ref expr,
        ref index,
    } = expr.kind
    {
        if let Ident(ref ident_name) = expr.kind {
            if sym == ident_name {
                return Some(*index);
            }
        }
    }
    None
}
Checks if `expr` is a `GetField` on an identifier with name `sym`. If so,
returns the field index being accessed.
weld/src/optimizer/transforms/inliner.rs