Commit Graph

6 Commits

Author SHA1 Message Date
John McCall
ab3f77baf2 Make SILInstruction no longer a subclass of ValueBase and
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.
2017-09-25 02:06:26 -04:00
practicalswift
7eb7d5b109 [gardening] Fix 100 typos. 2017-04-18 17:01:42 +02:00
Erik Eckstein
1702b831e4 StackNesting: fix use-after-free problem.
rdar://problem/31470661
2017-04-06 08:40:31 -07:00
Erik Eckstein
a43a844838 StackNesting: use the right debug locations for inserted deallocation instructions
Fixes a crash because we used a return-location for a deallocation instruction.

rdar://problem/31458587
rdar://problem/31458617
2017-04-05 18:05:39 -07:00
Erik Eckstein
c41de405c4 fix a wrong assert in StackNesting 2017-03-30 09:33:00 -07:00
Erik Eckstein
607318e0c7 Utility for correcting the nesting of stack allocation/deallocation instructions in SIL.
This is useful for optimizations (like AllocBoxToStack) which create (de-)alloc_stack instructions.
They can just insert the new instructions anywhere without worrying about nesting and correct the nesting afterwards.
2017-03-29 15:41:04 -07:00