John McCall
674c286f15
Make Callee part of the API to GenFunc.
...
Swift SVN r1587
2012-04-24 08:16:41 +00:00
John McCall
9192d39e7a
Here's a nickel, get a real compiler.
...
Swift SVN r1573
2012-04-23 23:55:13 +00:00
John McCall
3e2c295a43
Work around sabre's insistence on using obsolete technology.
...
Swift SVN r1571
2012-04-23 23:43:59 +00:00
John McCall
bc32a8aedb
Fix a bug with returning value that need to be refcounted:
...
we want to do a take-load out of the return address slot
instead of a normal load, or else we'll end up +1'ing an
already +1 value.
Swift SVN r1564
2012-04-23 17:47:07 +00:00
John McCall
d68fee8b41
Perform Builtin.load and Builtin.store using the type
...
info for the result/argument type. This makes them
properly generic over an arbitrary type.
Swift SVN r1563
2012-04-23 17:46:58 +00:00
Chris Lattner
6e7d1071d6
lshr is a useful builtin to have, just not useful for signed shift right :)
...
Swift SVN r1540
2012-04-21 05:28:04 +00:00
Doug Gregor
0bdca7425f
s/lshr/ashr/g in builtins.
...
Swift SVN r1537
2012-04-20 19:46:29 +00:00
Doug Gregor
8e7902e7a3
Manage objects (of type Builtin.ObjectPointer) loaded or stored via
...
Builtin.load_ObjectPointer/Builtin.store_ObjectPointer.
John, please review!
Swift SVN r1535
2012-04-20 19:41:50 +00:00
Doug Gregor
b237823246
Implement load and store builtins, which we use to provide get() and
...
set() functions for UnsafePointerInt.
Swift SVN r1533
2012-04-20 17:58:23 +00:00
Doug Gregor
e26d552a36
Implement integer shift-left/shift-right in the Swift standard library.
...
Swift SVN r1531
2012-04-20 16:33:38 +00:00
Eli Friedman
4ab945f192
Fix Ted's currying fractal example. <rdar://problem/11278150>.
...
Swift SVN r1506
2012-04-19 21:52:02 +00:00
Chris Lattner
a9d01aaaec
eliminate macro in favor of an old-school static function.
...
Implement irgen of ptrtoint and inttoptr, which are only overloaded
on one type. Patch 1.5/2 of builtin cast support.
Swift SVN r1434
2012-04-14 02:35:39 +00:00
Chris Lattner
4f4c8b1455
add initial support for Builtin cast instructions, patch #1/2.
...
Swift SVN r1433
2012-04-14 00:56:35 +00:00
Chris Lattner
868eccff76
implement a new Builtin.gep operation which maps to the LLVM Getelementptr instruction,
...
used for pointer offseting. We can figure out inbounds later. This is to be used by
UnsafePointerInt
Swift SVN r1429
2012-04-13 23:10:42 +00:00
Chris Lattner
c7c61ecc01
remove the unary neg/not builtins. They're not needed and don't match LLVM IR.
...
Swift SVN r1425
2012-04-13 21:59:56 +00:00
John McCall
5ad3782b01
Rework the IR-generation of initialization and teach the
...
compiler to enter properly-scoped cleanups to destroy local
variables.
Swift SVN r1385
2012-04-11 03:00:08 +00:00
John McCall
f3e27d90ff
Change IR-generation so that it emits metadata objects for the
...
heap allocations it makes, and switch swift_alloc over to pass
that pointer in as well as the alignment. Also, compute
whether a type is POD during its generation and cache that in
the object, and introduce a method on TypeInfo to destroy an
object in memory.
Swift SVN r1356
2012-04-10 06:28:22 +00:00
Chris Lattner
fbfb76a515
rename 'plus' methods to 'static' methods, resolving:
...
<rdar://problem/10718220> Need a better name than 'plus' for "static" functions
Swift SVN r1340
2012-04-06 17:50:43 +00:00
John McCall
ca9f85d694
Add code for associating cleanups with intermediate
...
evaluation results and then claiming or forwarding the
ownership of such results.
Swift SVN r1337
2012-04-06 07:07:28 +00:00
John McCall
edad637ddb
In preparation for Explosion storing some sort of cleanup pointer,
...
add some APIs for working with non-cleaned-up entities.
Swift SVN r1336
2012-04-06 07:07:22 +00:00
John McCall
44677bc117
Fixes and embellishments, and actually make IR-gen properly
...
emit release cleanups. And they work!
Swift SVN r1334
2012-04-05 20:36:20 +00:00
John McCall
82ca0e7720
Basic infrastructure for cleanup emission and branches. Totally untested!
...
Swift SVN r1332
2012-04-05 20:36:19 +00:00
Eli Friedman
d295d02c42
Initial interpreter implementation. The included pieces are enough to get the included simple.swift running in swift -i mode. <rdar://problem/10962290>, part 1.
...
Swift SVN r1319
2012-04-04 01:34:42 +00:00
Eli Friedman
29f3fca950
First iteration of CaptureAnalysis.
...
Swift SVN r1284
2012-03-29 00:24:03 +00:00
Eli Friedman
99b75ce728
Further progress on captures in closures.
...
Swift SVN r1279
2012-03-28 01:32:46 +00:00
John McCall
5e38419345
In a currying forwarder, force the release of the data allocation
...
between the point at which values were loaded out and the point
at which the call is performed. This is bad for some things,
like not spilling all the arguments, and good for others, like
not keeping the allocation around unnecessarily and being able
to do a tail call.
This has the side-effect of causing the release to actually occur,
since we're not doing cleanups yet.
Swift SVN r1276
2012-03-27 23:54:11 +00:00
John McCall
173d750a02
Switch IR-generation to use ASTVisitor, or more precisely, to
...
use irgen::ASTVisitor, which is a subclass of the AST version
that always looks through some expressions and asserts that
others (the unchecked/error ones) can't happen. The main
obstacle to that is access control, because it's quite nice to
have the visitor be a non-local class for nesting purposes,
but that makes it impossible to use private methods anymore.
It's nice to give all the type-specific emitters private
interfaces anyway, though; that ends up being most of the
patch.
I futzed with GenClosure.cpp while I was in there, but
separating it would have been obnoxious.
Swift SVN r1267
2012-03-26 06:08:19 +00:00
John McCall
df7ebcd9e8
Introduce the concept of an 'owned address', i.e. an address with
...
an owner attached. Use this to implement [byref(heap)]. Force
locals to the heap if they've been referenced in a way that requires
this.
Swift SVN r1265
2012-03-26 03:26:21 +00:00
Eli Friedman
ea17adc3ec
Completely switch over IRGen for closures to use the standard prologue/epilogue emission.
...
Swift SVN r1250
2012-03-22 01:04:05 +00:00
John McCall
5a4dfb6624
Beginnings of support for heap-allocated locals.
...
Swift SVN r1246
2012-03-20 19:42:03 +00:00
John McCall
99a6c4ccf1
Cache %refcounted* null. This will be particularly important
...
for heap l-values.
Swift SVN r1245
2012-03-20 19:42:00 +00:00
John McCall
d699e00390
Teach IR-gen how to efficiently emit a broad range of
...
expressions when no value is required. Teach IR-gen
to emit DotSyntaxBaseIgnoredExprs as known function
references with possibly non-trivial semantics.
Undo the change to getSemanticsProvidingExpr().
Swift SVN r1238
2012-03-19 08:59:35 +00:00
John McCall
52598e0e91
Kill more unnecessary 'Exploded's from method names, and do
...
a minor reorganization with CallPlan.
Swift SVN r1223
2012-03-17 00:44:58 +00:00
John McCall
e020724c3d
Distinguish between assignment and initialization, and fix
...
some problems with the data pointer of function types.
Swift SVN r1220
2012-03-16 19:02:25 +00:00
John McCall
53de72a7f1
Pull an unnecessary 'Explosion' out of some names.
...
Swift SVN r1217
2012-03-16 19:02:22 +00:00
John McCall
d76aaea2b6
Remove the outdated RValue concept; no functionality change.
...
Swift SVN r1216
2012-03-16 09:26:39 +00:00
John McCall
8831d35de1
The data pointer is also reference-counted.
...
Swift SVN r1215
2012-03-16 09:26:36 +00:00
John McCall
1f118dbda6
Basic support for Builtin.ObjectPointer as a completely
...
opaque type. Also some rudimentary support for retain/release.
Swift SVN r1214
2012-03-16 09:26:32 +00:00
Eli Friedman
2c4cc01fee
Make sure we consistently assign LLVM IR names to both function parameters and allocas created for those parameters. <rdar://problem/10934320>.
...
Swift SVN r1211
2012-03-15 00:04:07 +00:00
Eli Friedman
d466059220
Add support for IRGen for $0 etc.
...
Swift SVN r1210
2012-03-14 23:00:07 +00:00
Eli Friedman
ddffb633eb
Fix build errors with clang-421.
...
Swift SVN r1167
2012-03-05 19:31:12 +00:00
John McCall
803cff8113
Correctly emit references to oneof elements that carry no data.
...
These translate to implicit calls to the injection function.
Swift SVN r1116
2012-02-16 03:01:08 +00:00
John McCall
cd4c7f7818
Implement the emission of oneof injection functions. As always,
...
oneofs other than enums and singletons are not really implemented.
Swift SVN r1115
2012-02-16 01:57:08 +00:00
John McCall
2b65cf22d1
Make 'this' implicitly [byref] when the container type does
...
not have reference semantics. Deciding whether the container
type has reference semantics requires us to perform
some amount of limited name-binding and type-checking first,
which introduces a few complexities.
Also, fix a bug in uncurried call emission.
Methods work now.
Swift SVN r1112
2012-02-11 07:37:57 +00:00
John McCall
7b29a420f6
Design and implement the [byref] attribute, checking that
...
it doesn't appear in places it shouldn't. The only limits on
this checking right now is the inadequacy of location information
for types, which is something we ought to fix.
Fix type-checking of byref applications. Fix IR generation
of byref variables. Whole lotta fixin' goin' on.
But hey, byref calls work.
Swift SVN r1111
2012-02-10 09:42:50 +00:00
John McCall
76ad8fff02
Add more parentheses to Types.h.
...
Swift SVN r1103
2012-01-31 04:32:37 +00:00
John McCall
ce7780af04
I don't think we're really getting anything out of ArgDecl
...
at the moment. We can put it back if I'm wrong.
Swift SVN r1100
2012-01-26 02:08:52 +00:00
John McCall
16f8b2e656
Revise the language design for function argument clause syntax.
...
A function argument clause is now one or more patterns (which
must be parenthesized and explicitly type all positions) not
separated by arrows; the first arrow then separates off the
return type.
Revisions to language reference forthcoming.
Swift SVN r1099
2012-01-26 01:25:26 +00:00
John McCall
b85ddcb34a
IR generation for curried functions. For now, parameters
...
are stored in a malloc'ed buffer that gets leaked.
Swift SVN r1092
2012-01-19 23:29:49 +00:00
John McCall
b7e0b0ee06
Now that TupleTypeElts tell us directly what ArgDecls
...
are bound, bind ArgDecls correctly in uncurried functions.
Swift SVN r1080
2012-01-18 07:39:57 +00:00