Commits

Michael Gottesman committed a6bd0cce0fe
Change select* instructions so that all of them have the same tail allocated memory layout and add a SelectInst API that allows for one to access select inst operands when one does not care about what the cases actually are. Previously select_enum, select_enum_addr had the following memory layout: [operands], [cases] In constrast, select_value had the following layout: [operand1, case1, operand2, case 2, ...] The layout for select_value makes it impossible to just visit operands in a generic way via a higher level API. This is an important operation for many analyses such as AA on select insts. This commit does the following: 1. Adds a new abstract parent class for all select instructions called SelectInst. 2. Adds a new templated implementation parent class that inherits from SelectInst called SelectInstBase. This handles the complete implementation of select for all types by templating on CaseTy. 3. Changes SelectEnumAddrInst, SelectEnumInst, SelectValueInst to be thin classes that inherit from the appropriately specialized SelectInstBase. I left in SelectEnumInstBase for now as a subclass of SelectInstBase and parent class of SelectEnum{,Addr}Inst since it provides specific enum APIs that are used all over the compiler. All of these methods have equivalent methods on SelectInstBase. I just want to leave them for a later commit so that this commit stays small. Swift SVN r24159