Doing function generation in two passes so we can get the names and debug information right.