These changes implement the code to find values referenced inside outlined catch and cleanup handlers and relocate them to a frame allocation structure that is shared by the parent function and the handlers.
During outlining, temporary allocas are created in the handler function to represent the variable. If the value referenced was an alloca in the parent frame, the mapping is simple. Otherwise, the value will need to be spilled. (Spilling isn't working yet.) As values are referenced in handlers, they are added to a map that will be used for resolution later.
After all handlers have been outlined, we walk the map and add each referenced variable to a structure definition and store the index for the corresponding element. When this is complete, we add bitcasts to all of the handlers (which already have an instruction to get a raw pointer to the frame allocation block), create a frame allocation call in the parent function and finally replace both original and temporary allocas with GEPs.
In the case of an alloca which is referenced from only one handler and is not used in the parent frame after the outlined function have been pruned, the alloca is simply erased from the parent and left in the handler. No entry in the frame allocation structure is created for such variables. (This will probably require some additional handling once spills are working.)