Eli Friedman
05fe3c907f
Propagate a DeclContext through NameBinding for IdentifierTypes.
...
Swift SVN r1803
2012-05-10 23:34:01 +00:00
Eli Friedman
a143422c98
Teach name binding to look into default values for tuple types.
...
Swift SVN r1747
2012-05-04 23:09:55 +00:00
Eli Friedman
e6177f35a9
Get rid of the outdated notion of type lookup in Module. <rdar://problem/11026489>.
...
Swift SVN r1734
2012-05-04 00:41:54 +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
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
Doug Gregor
5fffa75e7b
Remove empty throw specifications from all of the overloaded new operators; reduces code size by 8k
...
Swift SVN r1282
2012-03-28 22:00:02 +00:00
Chris Lattner
50c95e7f32
resolve the FIXME.
...
Swift SVN r1172
2012-03-09 11:13:43 +00:00
Eli Friedman
48f0f1d77e
Fix assertion failure on tests.
...
Swift SVN r1168
2012-03-05 19:58:06 +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
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
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
ff130c602e
implement dot lookup in extensions!
...
Swift SVN r913
2011-12-07 00:11:01 +00:00
Chris Lattner
900d45f3c0
implement a Module::lookupExtensions method to find all the extensions for a
...
given type in a given module. This depends on llvm r145898.
Swift SVN r906
2011-12-06 02:07:13 +00:00
Chris Lattner
fcdddd8d97
move ASTStage up to Module, sigh.
...
Swift SVN r904
2011-12-06 01:20:18 +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
164ab0ffee
move lookupTypeName out to Module::lookupGlobalType and have it look in the current
...
module as well for consistency.
Swift SVN r811
2011-11-01 06:27:24 +00:00
Chris Lattner
e0a18996cd
move lookupGlobalValue into Module, making it accessable to all of sema.
...
Swift SVN r810
2011-11-01 06:22:44 +00:00
Chris Lattner
5d8d0fd2f6
Have the name binder publish the list of imported modules into the TranslationUnit,
...
making it a real part of the AST. Also, rework TUModuleCache to do its computation
when it is constructed, instead of trying in each query.
Swift SVN r809
2011-11-01 06:19:36 +00:00
Chris Lattner
e3b53c3b15
move the module-level name lookup stuff out of NameBinding.cpp into the
...
Module class. Add a new Module.cpp file to implement this (along with
the existing caching strategy, if you're curious). This eliminates the
parallel 'ModuleProvider' heirarchy.
Swift SVN r802
2011-11-01 05:19:35 +00:00
Chris Lattner
4933a27098
clean up lookupType/lookupValue to only take an AccessPath instead of an import decl.
...
Strip of the module name implicit in the access path.
Swift SVN r801
2011-11-01 04:43:51 +00:00
Chris Lattner
2ea1e72890
merge two copies of the same predicate into a helper method.
...
Swift SVN r800
2011-11-01 04:30:25 +00:00
Chris Lattner
8e1c6c8ac6
flatten ModuleKind discriminator into DeclContext's one. Now Module is an
...
abstract class and we have an actual AST-level concept of the builtin module.
Swift SVN r798
2011-11-01 04:07:57 +00:00
Chris Lattner
fed35466d4
increase the # bits for DeclContextKind's to 3 bits.
...
Swift SVN r797
2011-11-01 03:58:21 +00:00
John McCall
c61c807589
Mangle types for all declarations. Save the names of modules and mangle
...
those in, too.
Swift SVN r713
2011-09-18 09:21:42 +00:00
John McCall
d56299972b
Add the missing Module.h.
...
Swift SVN r697
2011-09-08 00:20:25 +00:00