Commit Graph

9332 Commits

Author SHA1 Message Date
Chris Lattner
8ad5ba2428 introduce an alloc_box instruction. Also, normalize alloc_array to follow
the syntax in SIL.rst.


Swift SVN r3224
2012-11-17 01:09:42 +00:00
Chris Lattner
ef2b8c054d add SILBase.cpp
Swift SVN r3223
2012-11-17 00:52:19 +00:00
Chris Lattner
fadda48e26 Switch the alloc_array instruction to return two results instead of a tuple.
Where before we had:

  %8 = alloc_array element type=Int, %7
  %9 = tupleelement %8, 1
  %10 = tupleelement %8, 0
  %11 = type_conversion %9 -> Builtin.RawPointer
..
  %17 = apply %16(%11, %10, %7)

we now have:

  %8 = alloc_array element type=Int, %7
  %9 = type_conversion %8#1 -> Builtin.RawPointer
..
  %15 = apply %14(%9, %8#0, %7)



Swift SVN r3220
2012-11-17 00:12:18 +00:00
Chris Lattner
c9831b0219 fix some SILPrinter bugs handling results with multiple values.
Swift SVN r3219
2012-11-17 00:10:49 +00:00
Chris Lattner
a2d60a1fe1 switch V->getType() uses (which are unsafe if V points to something with multiple results) to
V.getType() which returns the type of the value being referenced.


Swift SVN r3217
2012-11-16 23:57:11 +00:00
Chris Lattner
6ab2a17518 make ValueBase::getType() take a result number, right now default it to zero in the
base class, which is wrong.  Add shadowing versions that do allow no argument in 
derived classes where it is right.


Swift SVN r3216
2012-11-16 23:52:05 +00:00
Chris Lattner
09a0566d34 start getting crazy: store and control flow instructions now have no result.
Swift SVN r3210
2012-11-16 22:32:49 +00:00
Chris Lattner
4962f35f24 teach SILPrinter to print out %3#1 when referencing an instruction with multiple results.
Swift SVN r3209
2012-11-16 22:27:00 +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
4e1893236c switch the storage representation of Value::Type to be a PointerUnion<Type,TypeList*> handling
the 0/1/N cases of types.  Still only form the "1" case though.


Swift SVN r3206
2012-11-16 21:09:53 +00:00
Chris Lattner
4643edc850 initial support for uniquing SIL type lists, not used yet.
Swift SVN r3204
2012-11-16 19:45:51 +00:00
Joe Groff
b1c3995fdc SILGen: implement emitBranchAndCleanups
Emit the proper cleanups when generating a break or continue branch. Un-XFAIL SIL/statements.swift test.

Swift SVN r3198
2012-11-16 17:55:36 +00:00
Joe Groff
9967769d25 SILGen: Steal stupid cleanup support from IRGen
Port over the basic machinery to push and pop cleanups from IRGen, and implement simple straight-line cleanup emission. Add a basic cleanup for VarDecls as a proof of concept. More sophisticated handling of outflows, dormant/alive/dead states, etc. still needs to be carried over. Breaks test/SIL/statements.swift due to lack of support for cleanups through branches.

Swift SVN r3196
2012-11-15 22:24:10 +00:00
Joe Groff
b70534fc62 SIL: implement verifier for retain/release/destroy
Swift SVN r3195
2012-11-15 22:24:09 +00:00
Joe Groff
cb6d12d52d Revert "WIP"
Not ready for prime time, sorry.

This reverts commit 3185.

Swift SVN r3189
2012-11-15 00:11:40 +00:00
Joe Groff
9d08711627 WIP
Swift SVN r3187
2012-11-15 00:04:23 +00:00
Jordan Rose
ac5abd95d0 [CMake] Automagically add private headers in Xcode as well as public headers.
Swift SVN r3167
2012-11-13 19:05:17 +00:00
Joe Groff
3d346804fa Add headers to lib/SIL/SILGen/CMakeLists.txt
so that they show up in generated Xcode project.

Swift SVN r3160
2012-11-12 18:30:38 +00:00
Joe Groff
73f87996c3 SIL: add instruction types for ARC and lvalues
Add RetainInst, ReleaseInst, DeallocInst for managing object lifetimes, and CopyInst and DestroyInst for indirectly managing resilient types and other non-materializable types.

Swift SVN r3159
2012-11-12 18:00:16 +00:00
Joe Groff
064b2c517e SILGen: ret () instead of unreachable
If a ()-returning function falls off the end, generate a return instead of an unreachable. IRGenFunction::emitEpilogue has some more sophisticated logic that should be ported over, but this will handle the obvious T -> () case.

Swift SVN r3142
2012-11-09 23:07:45 +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
9eae97457e rename lib/SIL/CFG* to lib/SIL/SIL*
Swift SVN r3131
2012-11-07 01:07:08 +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
c7cbc8eb6a rename SILGen/CFG* to SILGen/SIL*
Swift SVN r3129
2012-11-07 00:58:10 +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
Chris Lattner
3a559b4318 rename include/swift/CFG -> include/swift/SIL.
Swift SVN r3127
2012-11-07 00:52:51 +00:00
Chris Lattner
3b83942aed rename CFGGen directory -> SILGen.
Swift SVN r3126
2012-11-07 00:48:40 +00:00
Chris Lattner
818de63f96 rename the CFG libraries to SIL
Swift SVN r3125
2012-11-07 00:46:49 +00:00
Chris Lattner
61309f0100 rename lib/CFG to lib/SIL
Swift SVN r3121
2012-11-07 00:39:49 +00:00