Eli Friedman
36472404b2
Parse swift.swift upfront in the REPL. This has two benefits: one, we error immediately if swift.swift can't be found, or something is wrong with it. Two, it lets us JIT swift.swift upfront, which makes the REPL prompt feel more responsive. <rdar://problem/11305258>.
...
Swift SVN r1575
2012-04-24 00:55:19 +00:00
Eli Friedman
a2c6150c13
Error recovery for the REPL. Seems to be working reasonably well. <rdar://problem/11269380>.
...
Swift SVN r1523
2012-04-20 01:14:39 +00:00
Eli Friedman
be602fcd05
Get rid of the implicit BraceStmt for the TranslationUnit; instead, have the TranslationUnit directly store a list of decls.
...
Swift SVN r1521
2012-04-20 00:17:13 +00:00
Eli Friedman
acc17d69aa
Initial implementation of the "print" part of the REPL.
...
Swift SVN r1484
2012-04-19 01:13:37 +00:00
Eli Friedman
37de44a35d
Implement changes to parsing/sema/etc so that we can implement a REPL and the main module parses the same way as a REPL.
...
Next step: implement an actual REPL.
Swift SVN r1441
2012-04-16 23:52:01 +00:00
Eli Friedman
9bf8dcf0f1
Delete some dead code.
...
Swift SVN r1412
2012-04-13 01:05:12 +00:00
Eli Friedman
1569d73cb2
Fix a crash involving extensions.
...
Swift SVN r1411
2012-04-13 00:48:53 +00:00
Doug Gregor
ba56d2c0b1
Implement support for lookup of members of the current
...
oneof/struct/protocol within a static method. The lookup is performed
on the metatype (as one would get when using qualified syntax
Type.member). Add tests to verify that this provides proper
overloading behavior.
As a drive-by, actually set the type of the implicit 'this' variable
during name binding for a non-static method.
Swift SVN r1394
2012-04-11 18:22:53 +00:00
Ted Kremenek
352453a53b
Revert "Fix a bunch of "has virtual functions but non-virtual destructor" warnings"
...
Swift SVN r1376
2012-04-11 00:02:16 +00:00
Ted Kremenek
8a61ea1fd0
Fix a bunch of "has virtual functions but non-virtual destructor" warnings
...
Swift SVN r1373
2012-04-10 23:53:46 +00:00
Eli Friedman
bb597c7a37
Minor cleanup.
...
Swift SVN r1354
2012-04-10 01:47:45 +00:00
Doug Gregor
c24d6ec8c4
Factor OverloadSetRefExpr into an abstract base class covering the
...
notion of a reference to a set of declarations. Introduce one derived
class, OverloadedDeclRefExpr, which covers the only case we currently
handle for overload resolution [*]: a direct (unqualified) reference
to an overloaded set of entities. Future subclasses should handle,
e.g., overloaded member references such as a.b or a.b.c.
[*] Ugly hacks for static methods notwithstanding
Swift SVN r1345
2012-04-09 17:16:11 +00:00
Eli Friedman
f477cf588e
Introduce the notion of the "main" module, i.e. the module which defines main(). Disallow top-level statements in modules other than the main module. Fix IRGen to generate a main() function in the main module, and implement top-level statements. Get rid of the main() mangling hack. Part of <rdar://problem/11185451>.
...
I haven't really carefully considered whether existing type-checking etc. is correct for the main module (I think the name-binding rules need to be a bit different?), but it seems to work well enough for the obvious cases.
This is enough to get the one-liner "println(10)" to print "10" in "swift -i" mode, although the path to swift.swift still needs to be explicitly provided with -I.
Swift SVN r1325
2012-04-05 00:35:28 +00:00
Eli Friedman
22b7cd05f5
Some minor incremental improvements for module import. Allow explicitly importing Builtin, and implicitly import swift for any module which doesn't explicitly import Builtin or swift. Fixes <rdar://problem/11185519>.
...
Swift SVN r1323
2012-04-04 21:56:40 +00:00
Chris Lattner
8aafdda9f6
after an epic refactoring fest, finally implement ivar/method lookup in methods, resolving rdar://10682135.
...
There are still problems in the field of name lookup, but this is progress at least.
Swift SVN r1235
2012-03-19 06:08:57 +00:00
Chris Lattner
92f3d6a431
checkpoint, nothing useful here.
...
Swift SVN r1228
2012-03-19 05:15:59 +00:00
Chris Lattner
60d9b2a570
intermediate progress on rdar://10682135, nothing particularly useful so far.
...
Swift SVN r1207
2012-03-11 23:57:09 +00:00
Chris Lattner
0cccfe9299
rename the Walker class to ASTWalker to match ASTVisitor.
...
Swift SVN r1201
2012-03-11 16:28:50 +00:00
Eli Friedman
862646c1dd
Perform conversion to bool in conditionals by repeatedly calling ".getLogicValue()" on the value until we reach Builtin.Int1, instead of using convertToLogicValue(). <rdar://problem/10100856>.
...
Swift SVN r1173
2012-03-10 00:02:36 +00:00
Eli Friedman
ddffb633eb
Fix build errors with clang-421.
...
Swift SVN r1167
2012-03-05 19:31:12 +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
e66c13cfe7
Change the 'walk' APIs to use virtual function dispatch
...
instead .
1,2d
1i
Change the 'walk' APIs to use virtual dispatch instead of
blocks. This makes it much easier to thread information
through the API, as well to extend the API to handle
recursive visiting of other structures (e.g., Decls
and Patterns).
Swift SVN r1101
2012-01-26 04:31:38 +00:00
Chris Lattner
4ef27b82e4
simplify some code to use a foreach loop.
...
Swift SVN r1089
2012-01-19 06:41:49 +00:00
Chris Lattner
599e4b2528
switch to using the new llvm::MutableArrayRef class, this requires llvm r148463
...
Swift SVN r1088
2012-01-19 06:39:07 +00:00
Chris Lattner
e3298d8b98
rearrange some code to simplify it.
...
Swift SVN r1077
2012-01-18 07:26:47 +00:00
Chris Lattner
23a7fb46c1
now that name binding doesn't have weird "only kill some subtrees" behavior, switch it over to a standard walk.
...
Swift SVN r1076
2012-01-18 07:25:28 +00:00
Chris Lattner
0587519685
remove some bogus code now that name binding doesn't kill subtrees. Spare the forest!
...
Swift SVN r1075
2012-01-18 07:22:22 +00:00
Chris Lattner
ed7062c452
instead of having name binding kill off entire subtrees that contain invalid variable uses, have it turn the ivalid use into an ErrorExpr.
...
Swift SVN r1074
2012-01-18 07:21:25 +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
Chris Lattner
fa2ea94348
always turn a named reference to a type into an IdentifierType.
...
This preserving source location info and reduces redundancy in the parser.
Swift SVN r1065
2012-01-18 01:57:44 +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
Chris Lattner
2f7cd03c6b
switch type lookup to use value lookup for everything. Dead code ahoy.
...
Swift SVN r1057
2012-01-17 07:36:16 +00:00
Chris Lattner
51e44891af
rip out now-dead code from NameBinding. It still generally needs to be beaten
...
into sense later, but this gets it closer to reasonable.
Swift SVN r1051
2012-01-17 06:35:34 +00:00
Chris Lattner
c8ca11a199
Drop in the new DottedNameType and wire it up in name binding.
...
This is horribly hack and slash (but enough to pass all tests) for a few reasons:
- I've #if 0'd out the tendrils of the old code
- This handles *just* what was handled before instead of being more general
- We don't have an llvm::MutableArrayRef type, so there is some really gross
const_cast'ing and other struggles to deal with its absence.
Swift SVN r1050
2012-01-17 06:32:00 +00:00
Chris Lattner
fab4ef8820
introduce a new OverloadSetRefExpr::createWithCopy method to eliminate
...
some redundancy in the code that always has to create an overload set
or a single declrefexpr depending on what various lookups produce.
Swift SVN r1044
2012-01-14 07:22:25 +00:00
Chris Lattner
f1db6de509
remove the :: token and DCE UnresolvedScopedIdentifierExpr.
...
Swift SVN r1043
2012-01-14 07:00:45 +00:00
Chris Lattner
9d10d231ea
implement support for normal lookup to find module names, and build a
...
ModuleExpr of the right type to represent it. Not tested yet, because
nothing can handle module exprs.
Swift SVN r1041
2012-01-14 06:41:33 +00:00
Chris Lattner
ed47f92c85
remove the ability for a::b to resolve a member 'b' in type 'a'. It now
...
just works for module references like Builtin::int32.
Swift SVN r1028
2012-01-12 21:54:32 +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
0138e451a1
Look through extension decls here, too. It's not clear to me why
...
we can't just the normal walker for this top-level walking.
Swift SVN r985
2011-12-23 02:36:14 +00:00
John McCall
6b935588e5
On second thought, components need to be known in the AST.
...
Swift SVN r918
2011-12-07 03:57:41 +00:00
Chris Lattner
a1b7419a36
remove support for looking up global names with dot syntax. "x.y" != "y(x)" now.
...
Swift SVN r917
2011-12-07 00:59:09 +00:00
Chris Lattner
5da9f8ade2
add TinyPtrVector to LLVM.h
...
Swift SVN r905
2011-12-06 01:46:23 +00:00
Chris Lattner
32b248b7e3
[gs]etterize various members of Module, and make them check the invariants they depend on.
...
Swift SVN r903
2011-12-06 01:02:09 +00:00
Chris Lattner
212b56afec
actually, the ASTStage should be on Translation unit. There can be multiple modules in a context and they can all be in different phases of translation.
...
Swift SVN r902
2011-12-06 00:51:56 +00:00
Chris Lattner
eaa6fcb12a
move prototype for the verifier into Subsystems.
...
Swift SVN r901
2011-12-06 00:34:16 +00:00
Chris Lattner
02c9d9a3f1
Make the AST "phase" part of ASTContext, this is generally useful for assertions.
...
Swift SVN r900
2011-12-06 00:32:00 +00:00
John McCall
d716f82984
Getterize ValueDecl.
...
Swift SVN r885
2011-11-18 01:04:12 +00:00
John McCall
9079154ded
Getterize TypeAliasDecl.
...
Swift SVN r884
2011-11-18 00:48:14 +00:00
John McCall
50fb0d63f6
More incremental getterization.
...
.w
Swift SVN r883
2011-11-18 00:29:15 +00:00