fn symbol_for_statement(
        &mut self,
        prog: &mut SirProgram,
        func: FunctionId,
        block: BasicBlockId,
        sym_ty: &Type,
        kind: StatementKind,
    ) -> Symbol {
        use crate::sir::StatementKind::CUDF;

        let site = ProgramSite(func, block);
        let map = self
            .generated
            .entry(site)
            .or_insert_with(fnv::FnvHashMap::default);

        // CUDFs are the only functions that can have side-effects so we always need to give them
        // a new name.
        if let CUDF { .. } = kind {
            let res_sym = prog.add_local(sym_ty, func);
            prog.funcs[func].blocks[block]
                .add_statement(Statement::new(Some(res_sym.clone()), kind));
            return res_sym;
        }

        // Return the symbol to use.
        match map.entry(kind.clone()) {
            Entry::Occupied(ent) => ent.get().clone(),
            Entry::Vacant(ent) => {
                let res_sym = prog.add_local(sym_ty, func);
                prog.funcs[func].blocks[block]
                    .add_statement(Statement::new(Some(res_sym.clone()), kind));
                ent.insert(res_sym.clone());
                res_sym
            }
        }
    }
Returns a symbol holding the value of the given `StatementKind` in `(func, block)`. If a
symbol representing this statement does not exist, the statement is added to the program
and a new `Symbol` is returned.

This function should not be used for statements with _named_ parameters (e.g., identifiers,
parameters in a `Lambda`, or names bound using a `Let` statement.)!
weld/src/sir/mod.rs