Commit Graph

815 Commits

Author SHA1 Message Date
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
John McCall
610e14eeda Use a PrettyStackTraceDecl to note that we're emitting the
body of a particular function.



Swift SVN r1072
2012-01-18 07:15:52 +00:00
John McCall
603f7a13b9 Modify this to not do a direct access to a private member.
I filed Clang PR11793 to track the apparent lapse in access
control.



Swift SVN r1071
2012-01-18 07:08:38 +00:00
Chris Lattner
7d0f7d53f9 improve type safety and specificity a bit, the body of a function is always a FuncExpr.
Swift SVN r1069
2012-01-18 06:56:53 +00:00
John McCall
9c63d1e7e6 Fix a bug with curried function emission and teach the mangler
to differentiate uncurried and curried function types.



Swift SVN r1059
2012-01-17 08:08:47 +00:00
John McCall
5dde760272 Switch function prologue and application over to using Explosion
and teach them about currying.



Swift SVN r1038
2012-01-13 10:08:14 +00:00
John McCall
0e638a02ea IR generation for plus func references. I'm not convinced
that we should permit these references, really.



Swift SVN r1025
2012-01-12 21:27:26 +00:00
John McCall
286abfc5f7 Mostly kill off RValue. More tomorrow. :)
Swift SVN r1020
2012-01-12 10:18:40 +00:00
John McCall
885783ab76 Start switching things over to using explosions.
Swift SVN r1014
2012-01-12 07:05:49 +00:00
John McCall
c7bcadf450 On further reflection and use, the concept of an RValue is not actually
very useful;  it is much more interesting to divide r-value emission
into "to arguments" and "to memory" models.  To that end, introduce a
new structure for holding an "exploded" r-value.



Swift SVN r1006
2012-01-11 23:59:57 +00:00
John McCall
632b979188 Skeletal IR gen support for ExtensionDecl.
Swift SVN r981
2011-12-23 00:30:24 +00:00
John McCall
510d80f706 Fix alignment computation.
Swift SVN r977
2011-12-22 23:47:35 +00:00
John McCall
6bb1b947d8 Emit initializers of global variables as global constructors.
This isn't the actor model for globals, but is certainly still a
valid model.



Swift SVN r975
2011-12-22 23:35:41 +00:00
Chris Lattner
d525ba5fda simplify builtin type processing by eliminating BuiltinTypeKind.
Swift SVN r967
2011-12-22 07:38:17 +00:00
John McCall
9b7fb0c227 New l-value representation.
Swift SVN r956
2011-12-22 05:28:33 +00:00
John McCall
88d0f28698 Correctly call oneof injections.
Swift SVN r940
2011-12-15 03:20:02 +00:00
John McCall
b69d5f95cd Implement tuple shuffles.
Swift SVN r890
2011-11-18 10:10:21 +00:00
John McCall
d716f82984 Getterize ValueDecl.
Swift SVN r885
2011-11-18 01:04:12 +00:00
John McCall
50fb0d63f6 More incremental getterization.
.w



Swift SVN r883
2011-11-18 00:29:15 +00:00
John McCall
d74f17259c Incremental getterization of Decl.h.
Swift SVN r882
2011-11-18 00:17:20 +00:00
Chris Lattner
0ca79b1075 rename ASTContext::BuiltinModule -> TheBuiltinModule for consistency with
the other ASTContext members.


Swift SVN r799
2011-11-01 04:18:23 +00:00
Chris Lattner
60afdf4842 switch irgen to new diags
Swift SVN r769
2011-10-20 21:29:50 +00:00
John McCall
b351394b6e Getterify the rest of Expr.h.
Swift SVN r719
2011-09-20 00:18:57 +00:00
John McCall
802262a7da More incremental getterization.
Swift SVN r718
2011-09-19 23:37:21 +00:00
John McCall
7a259f4bad Differentiate between the starting location and caret location of
an expression.  More incremental getterization.



Swift SVN r717
2011-09-19 22:45:58 +00:00
John McCall
02e47ed9ce Privatize Expr's Ty and Kind members; introduce getters and setters.
Swift SVN r716
2011-09-19 22:00:20 +00:00
John McCall
c3fb2ec8ba Missing commit.
Swift SVN r705
2011-09-14 22:26:50 +00:00
John McCall
37b07c8691 Add builtin bindings for a bunch of primitive LLVM instructions.
Swift SVN r698
2011-09-08 00:21:11 +00:00