visitor: Use for statement when iterating BlockStatement members.

This allows the statement list to be modified while being visited.
semantic: Remove unneeded module parameter from emitNestedStructs.
llvm: Add currentIrFunc to State.
semantic: Add this variable in parent function to nested struct, and assign to it.