Commit Graph

28 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
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Michael Gottesman
96837babda Merge pull request #5920 from gottesmm/vacation_gardening
Vacation gardening
2016-11-25 09:17:21 -06:00
Michael Gottesman
bf6920650c [gardening] Drop BB from all argument related code in SILBasicBlock.
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()
2016-11-25 01:14:36 -06:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
practicalswift
b19481f887 [gardening] Fix 67 recently introduced typos 2016-09-16 11:16:07 +02:00
Roman Levenstein
d92c4cc379 [sil-cloner] Always call doPreProcess when visiting SILInstructions.
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
2016-08-03 15:07:28 -07:00
Erik Eckstein
74d44b74e7 SIL: remove SILValue::getDef and add a cast operator to ValueBase * as a repelacement. NFC. 2016-01-25 15:00:49 -08:00
practicalswift
50baf2e53b Use consistent formatting in top of file headers. 2016-01-04 02:17:48 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Michael Gottesman
3525fac72d [specialization] Refactor SILCloner/SILVisitor to use an asImpl() method instead of directly calling static_cast.
NFC.

Swift SVN r16045
2014-04-08 03:25:29 +00:00
Chris Lattner
ef93c81ffb Introduce a new SIL-level "undef" value, useful for SIL transformations.
IRGen support is missing, Joe volenteers to implement it.


Swift SVN r9776
2013-10-30 00:58:09 +00:00
John McCall
2e41a8dcc6 Fix CRTP on SILVisitor.
Swift SVN r9206
2013-10-11 18:09:19 +00:00
Michael Gottesman
2bbdee69cc Fixed bug where SILInstructionVisitor was expecting visitSILArgument to have ValueRetTy not void.
The reason this bug survived is that by default ValueRetTy is void.

Swift SVN r8721
2013-09-27 05:23:59 +00:00
John McCall
7e15f0a557 Make SIL-visiting not have a default implementation, make classof
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
2013-04-12 01:39:52 +00:00
Chris Lattner
965242a833 rename SILBBArgument.h -> SILArgument.h to match the class name.
I'm done with renaming for now, boy do my fingers hurt.


Swift SVN r4595
2013-04-03 21:08:38 +00:00
Chris Lattner
a71bc3a78e rename Value -> SILValue, BasicBlock -> SILBasicBlock, BBArgument -> SILArgument.
Swift SVN r4594
2013-04-03 21:05:42 +00:00
Chris Lattner
1beebda868 move Instruction/BasicBlock/BBArgument files to have SIL prefixes.
Swift SVN r4591
2013-04-03 18:43:54 +00:00
Chris Lattner
65cd2b2d25 rename swift::Function to swift::SILFunction to be more explicit.
Swift SVN r4590
2013-04-03 18:36:15 +00:00
Chris Lattner
05dcf38c1c move SIL/Function.h to SILFunction.h in preparation to renaming the class.
Swift SVN r4589
2013-04-03 18:27:54 +00:00
Joe Groff
ac0713432b SILVisitor: Visit basic blocks and bb arguments.
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
2013-01-10 03:45:36 +00:00
Chris Lattner
d87f65f1a3 Land a pretty big conceptual/API change to pave the way for multiple
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
2012-11-16 22:21:47 +00:00
Chris Lattner
091bf35360 rename SIL.h -> Function.h
Swift SVN r3135
2012-11-07 01:39:05 +00:00
Chris Lattner
6cadce0ab1 rename the CFG type to "Function", since it is the SIL Function concept,
which is separable from the SIL library.


Swift SVN r3134
2012-11-07 01:37:49 +00:00
Chris Lattner
57eea530a9 more random changes CFG -> SIL
Swift SVN r3133
2012-11-07 01:31:27 +00:00
Chris Lattner
8eec098ffd rename more references to CFGs to SIL.
Swift SVN r3132
2012-11-07 01:13:31 +00:00
Chris Lattner
eab0962c5f rename many references to CFG to SIL.
Swift SVN r3130
2012-11-07 01:06:19 +00:00
Chris Lattner
93ae03891d rename the SIL/CFG*.h headers to SIL/SIL*.h
Swift SVN r3128
2012-11-07 00:56:21 +00:00