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.
This reverts commit ff8f5fceb7.
That commit was applied to master-next for changes in swift-llvm's
upstream-with-swift branch that are not included in the swift-4.1-branch.
This patch started with a suggestion from Adrian Prantl to adapt to
LLVM r307953. The code has changed more since then so I modified it
to get it to build and I also fixed up StackPromotion to deal with related
changes. (I did not search back very far but it looks like the StackPromotion
change may have been a latent bug that did not matter much until recent
changes started using the function parameter.)
This change is needed for the next update to ToT LLVM. It can be put
into place now without breaking anything so I am committing it now.
The churn upstream on ilist_node is neccessary to remove undefined
behavior. Rather than updating the different ilist_node patches for the
hacky change required to not use iterators, just use iterators and keep
everything as ilist_nodes. Upstream they want to eventually do this, so
it makes sense for us to just do it now.
Please do not introduce new invocations of
ilist_node::get{Next,Prev}Node() into the tree.
type, though; I had to define a WriteAsOperand function and
add a front() method to SILFunction to get this to work.
Rip out my dominators implementation and replace it with
LLVM's. I'd forgotten that LLVM's was actually generic.
Swift SVN r4717