Commits
Michael Gottesman committed a4a633351f1
[projection] Make projection constructors private and create static failable initializers using Optional. This changes the Projection API so that you pass in an instruction and get back an optional depending on what theinstruction was. This is much cleaner than always needing to do a switch. This commit also cleans up the naming in Projection so that we always use the term "value projection" for struct_extract, tuple_extract, and unchecked_enum_data instead of the term "extract". This lines up better with the name we use for the *_addr instructions, "address projection" and avoids ambiguity since unchecked_enum_data does not have the word "extract" in it. Additionally by adding in the failable initializers, my centralization of the initialization logic enables me to ensure that isAddrProjection and isValueProjection stay in sync with the various constructors via asserts. This should prevent future bugs if we add additional notions of "projection". Swift SVN r23356