introduce a common superclass, SILNode.
This is in preparation for allowing instructions to have multiple
results. It is also a somewhat more elegant representation for
instructions that have zero results. Instructions that are known
to have exactly one result inherit from a class, SingleValueInstruction,
that subclasses both ValueBase and SILInstruction. Some care must be
taken when working with SILNode pointers and testing for equality;
please see the comment on SILNode for more information.
A number of SIL passes needed to be updated in order to handle this
new distinction between SIL values and SIL instructions.
Note that the SIL parser is now stricter about not trying to assign
a result value from an instruction (like 'return' or 'strong_retain')
that does not produce any.
Before this commit all code relating to handling arguments in SILBasicBlock had
somewhere in the name BB. This is redundant given that the class's name is
already SILBasicBlock. This commit drops those names.
Some examples:
getBBArg() => getArgument()
BBArgList => ArgumentList
bbarg_begin() => args_begin()
It is important to call doPreProcess to correctly setup the available opened archetypes which were referenced from the original instruction being copied.
This fixes a concrete bug in LoopRotate optimization and potential bugs related to cloning.
rdar://27659420
take a const ValueBase* instead of a SILValue, implement SILArgument
cases for a few visitors and opt others out explicitly, and assert
that classes in the SIL value hierarchy override their superclass's
classof.
Swift SVN r4705
Handle overridden visitFunction and visitBasicBlock methods, and in the default implementation of visitBasicBlock, recur into the block's arguments in addition to its instructions.
Swift SVN r3726
return values. Now the base class of the value hierarchy is "ValueBase"
instead of "Value", and "Value" is now a PointerIntPair indicating the
ValueBase (e.g. an instruction) being referenced along with what result
value is being referenced.
By default, any place you used "Value*" before, you should now use "Value".
Swift SVN r3207