Commit Graph

621 Commits

Author SHA1 Message Date
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
Eli Friedman
361481835c Introduce a notion of module scope declarations; use it where appropriate instead of checking for a local declcontext.
Swift SVN r1380
2012-04-11 02:52:40 +00:00
Chris Lattner
65b400e30d introduce a new "Builtin.RawPointer" type, which corresponds to LLVM's "i8*" type,
and is just an unmanaged pointer.  Also, introduce a basic swift.string type.

This is progress towards rdar://10923403 and strings.  Review welcome.



Swift SVN r1349
2012-04-10 00:52:52 +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
John McCall
b2a2027a43 Revert r1144, r1145, and r1146. These changes (which removed ParenType
in favor of a single-element non-canonical TupleType) broke the type
system, in that supposed sugar (the TupleType) supported a different
set of operations from the canonical type.  For example, a
single-element unlabelled tuple type supports elementwise projection
(foo.$0), but the underlying element does not (or supports it
differently).

The IR-gen failure was due to a very related problem:  IR-gen
was not updated to reflect that a single unlabelled tuple element
is the same type as its element type, and therefore it was giving
different representations to these types ({ %foo } and %foo,
respectively), which broke widespread assumptions.

The removal of ParenType was done in pursuit of an AST invariant
that's not actually particularly interesting in the first place
and which, furthermore, is problematic to attain.

Swift SVN r1182
2012-03-11 09:15:21 +00:00
Chris Lattner
2d7babaf43 clean up some stuff around function argument types.
Swift SVN r1148
2012-03-02 00:25:31 +00:00
Chris Lattner
d3d724cab9 rename Builtin.int -> Builtin.Int
Swift SVN r1133
2012-03-01 17:48:38 +00:00
Chris Lattner
81ed1061eb change the builtin fp types to be FPIEEE32 instead of FP_IEEE32. They're completely private and this simplifies buildin processing, which wants to use _ for overloading.
Swift SVN r1122
2012-02-26 16:55:19 +00:00
Chris Lattner
1d6d89af1d implement support for overloaded builtins with floating point operands.
Use that to implement operator* for doubles in swift.swift, remove the implementation
from stdlib.cpp.


Swift SVN r1121
2012-02-26 16:53:24 +00:00
John McCall
4477b90156 Require creators of initialized TupleTypeElts to provide
both of the semantically-important fields.  Make the
default constructor trivial, or at least closer to trivial.
Provide a space in TupleTypeElt for the parser to drop in
the ArgDecl corresponding to this element.



Swift SVN r1068
2012-01-18 06:54:53 +00:00
Chris Lattner
19b7a934a1 rename BuiltinFloatingPointType to BuiltinFloatType.
Swift SVN r980
2011-12-23 00:07:58 +00:00
Chris Lattner
c91c1d9db1 generalize builtin floating point types to support all of the FP types
that LLVM supports.  The standard library still only exports float and double,
but the swift core should be more general.  Yay for PPC128 :)


Swift SVN r973
2011-12-22 22:01:07 +00:00
Chris Lattner
33f784d48e zap some #if 0 code accidentally left in
Swift SVN r970
2011-12-22 07:45:45 +00:00
Chris Lattner
d525ba5fda simplify builtin type processing by eliminating BuiltinTypeKind.
Swift SVN r967
2011-12-22 07:38:17 +00:00
Chris Lattner
6a51dbba34 Remove hard coded list of integer types from ASTContext, making BuiltinIntegerType have a "plus" factory method to create them like other types.
Swift SVN r966
2011-12-22 07:07:01 +00:00
Chris Lattner
17b11e9bbd implement parsing, AST, and LangRef support for 'plus' methods. Dot syntax will need some work though to actually use them.
Swift SVN r949
2011-12-21 23:21:58 +00:00
John McCall
a1f7eefba3 Extract out decl attributes into a separately-allocated structure.
Swift SVN r920
2011-12-10 00:39:10 +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
a7c7d64fa0 Switch swift to use SourceLoc instead of SMLoc.
Also use the new getAdvancedLoc() method instead of hacking
on SMLoc directly.

Also fix the warning/note/error methods to forward through ASTContext
instead of being replicated everywhere.



Swift SVN r750
2011-10-18 01:22:29 +00:00
Chris Lattner
8e369b34da make builtins.cpp include its header first (exposing that it isn't actually self-contained),
and switch to AST.h


Swift SVN r699
2011-09-09 04:58:39 +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