Commit Graph

12816 Commits

Author SHA1 Message Date
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
d0f4d86f3e Use LValueType everywhere instead of the l-value value kind.
Kill off TypeJudgement.  Various fixes and improvements.



Swift SVN r1107
2012-02-06 22:47:08 +00:00
John McCall
6ff9afb6f5 Introduce LValueType.
Swift SVN r1105
2012-02-02 00:57:10 +00:00
John McCall
6d8837dc8d Macro metaprogramming for types.
Swift SVN r1104
2012-02-01 22:37:59 +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
430fbcce6f Set up a simple query which asks whether a type is known to be
a single retainable object pointer.



Swift SVN r1094
2012-01-24 22:25:57 +00:00
John McCall
ea6d6f6f51 Define ResilienceScope, which is used to make optimizations more
aggressive when their ramifications are purely local.



Swift SVN r1093
2012-01-24 22:25:10 +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
883a16710b Extract out struct layout into a separate file. No clients yet.
Swift SVN r1091
2012-01-19 23:28:41 +00:00
John McCall
213d61361a It is no longer necessary to remember all the ArgDecls
in a FuncExpr.  This coincidentally means that we can
create the FuncExpr before we create the ArgDecls and
thus avoid the need to reparent them all.



Swift SVN r1081
2012-01-18 07:45:44 +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
Chris Lattner
584ed537fc introduce a new ErrorExpr to represent a subexpression that is semantically
inconsistent (so it needs to be killed) but that we want to retain source
range information and not kill the entire subtree that contains it.


Swift SVN r1073
2012-01-18 07:18: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
ea5e37e276 Getterize uses of TupleTypeElt. I'm trying to figure out how
parameter attributes should work here.



Swift SVN r1066
2012-01-18 04:05:25 +00:00
Chris Lattner
1c42e8f6a6 rename DottedNameType to IdentifierType. It captures loc information for random uses of type names, among other things.
Swift SVN r1064
2012-01-18 01:52:28 +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
Chris Lattner
3303aaca7b I must have accidentally disabled all the move logic in DiverseStack at some point,
reenable it.


Swift SVN r1052
2012-01-17 06:37:34 +00:00
Chris Lattner
4f8193956d introduce DottedNameType, which will eventually be used for foo.bar in a type context.
Swift SVN r1049
2012-01-17 01:55:17 +00:00
John McCall
8f60dafc76 Recommit r1044 out of spite.
Swift SVN r1048
2012-01-16 07:03:59 +00:00
Chris Lattner
26fbedee09 revert r1044, it looks like Linking.h wasn't 'svn add'ed.
Swift SVN r1047
2012-01-16 06:59:19 +00:00
John McCall
2fa6d329be Propagate currying/explosion information down to the
mangler.  No functionality change.



Swift SVN r1046
2012-01-14 09:44:30 +00:00
John McCall
44da666866 Move ExplosionKind to IRGen.h so that using it doesn't
require Explosion.h.  This is just to isolate the parts
of IR-generation that shouldn't have anything to do with
emitting code within functions.



Swift SVN r1039
2012-01-13 10:20:59 +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
Chris Lattner
be666df09e introduce a ModuleExpr node.
Swift SVN r1035
2012-01-13 05:07:21 +00:00
Chris Lattner
73570ac177 introduce a new ModuleType, which will be the type given to ModuleExpr's.
Swift SVN r1034
2012-01-13 04:51:39 +00:00
John McCall
22b7ed948a Eliminate the implosion/RValue-projection code, which is now dead.
Swift SVN r1031
2012-01-12 22:55:55 +00:00
John McCall
5b1fbce82b More renaming.
Swift SVN r1030
2012-01-12 22:54:11 +00:00
John McCall
16ebb9e4f5 Rename.
Swift SVN r1029
2012-01-12 22:51:18 +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
59bed696a5 Introduce a ParenExpr to represent the special case of
a tuple with one element and no labels.  This form is
treated specially in essentially every case, so it might
as well be its own expression kind.



Swift SVN r1021
2012-01-12 19:55:06 +00:00
John McCall
286abfc5f7 Mostly kill off RValue. More tomorrow. :)
Swift SVN r1020
2012-01-12 10:18:40 +00:00
Chris Lattner
c1d68d9fcc constructor call and dotsyntaxcall are just sugar for applyexpr.
Swift SVN r1019
2012-01-12 08:07:43 +00:00
John McCall
885783ab76 Start switching things over to using explosions.
Swift SVN r1014
2012-01-12 07:05:49 +00:00
Chris Lattner
9f5d37dd2f introduce a new ConstructorCallExpr node, which is sugar node used to represent
the syntactic form of an argument list applied to a metatype.  Semantically,
this is yet-another ApplyExpr.


Swift SVN r1008
2012-01-12 05:43:07 +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
Chris Lattner
37cb633b12 Change TypeAliasDecl to be a ValueDecl, whose type is MetaTypeType.
Swift SVN r1004
2012-01-11 07:13:32 +00:00
Chris Lattner
e22a30a130 revert r995: "introduce MetaTypeDecl (though nothing creates it yet)".
After some pondering on this, I can just use DeclRefExpr(TypeAliasDecl) to
represent a named metatype, there is not need to have yet-another decl.  I'm
glad about this, because it didn't seem right.



Swift SVN r999
2012-01-11 05:42:22 +00:00
Chris Lattner
f204abf010 introduce MetaTypeDecl (though nothing creates it yet)
Swift SVN r997
2012-01-06 20:50:56 +00:00
Chris Lattner
527c58f846 implement MetaTypeType, the type system representation of a metatype.
Swift SVN r996
2012-01-06 19:51:50 +00:00
John McCall
7e2b5e5410 Missing cases.
Swift SVN r994
2012-01-06 04:12:41 +00:00
John McCall
d559794e73 Introduce a new kind of sugar, ParenType. A tuple with one
anonymous member is actually one of these.

A func decl is curried over all of its parameter clauses,
as long as they're written without parentheses.  So the body
of a func is the body of the "most curried" function:
  func foo(x:int) -> (y:int) -> int {
    // This is the body of the function that takes 'y'.
    // It returns an int.
  }
  func bar(x:int) -> ((y:int) -> int) {
    // This is the body of the function that takes 'x'.
    // It returns a functon of type (y:int) -> int.
  }



Swift SVN r993
2012-01-06 04:10:32 +00:00
John McCall
c6decb43e9 Emit plus functions as normal global functions.
I meant to do this first.



Swift SVN r983
2011-12-23 01:20:26 +00:00
John McCall
632b979188 Skeletal IR gen support for ExtensionDecl.
Swift SVN r981
2011-12-23 00:30:24 +00:00
Chris Lattner
19b7a934a1 rename BuiltinFloatingPointType to BuiltinFloatType.
Swift SVN r980
2011-12-23 00:07:58 +00:00
Chris Lattner
320e4747cc Codegen was silently truncating IntegerLiteralExpr's to 64 bits, bad codegen!
Swift SVN r979
2011-12-23 00:04:06 +00:00