Commit Graph

189 Commits

Author SHA1 Message Date
Chris Lattner
e0dbcc40de split memorypromotion into two different passes, split its testcases
in half, and switch them to use sil-opt to test with.


Swift SVN r6469
2013-07-22 20:59:28 +00:00
Anna Zaks
a984d9b24c Move the SIL diagnostic emission entrypoint from SILGen to the top level swift.cpp driver
This addresses Chris’s review of r6151.

Swift SVN r6290
2013-07-16 18:53:23 +00:00
Chris Lattner
ba4c64479c Have -emit-sil[gen] print a couple of import options. This is a hack (the right answer
is to print all referenced decls at the start of a .sil file), but it is a useful hack.



Swift SVN r6251
2013-07-15 15:49:29 +00:00
Chris Lattner
1277ac7e04 Carve out a new lib/SIL/Passes directory to hold future SIL optimizations
and dataflow warnings.  Add a skeletal MemoryPromotion entrypoint as the first
exemplar.


Swift SVN r6247
2013-07-15 14:51:37 +00:00
Dmitri Hrybenko
3c5b12fc0f Code completion: add a lot of infrastructure code
* Added a mode in swift-ide-test to test code completion.  Unlike c-index-test,
  the code completion token in tests is a real token -- we don't need to
  count lines and columns anymore.

* Added support in lexer to produce a code completion token.

* Added a parser interface to code completion.  It is passed down from the
  libFrontend to the parser, but its functions are not called yet.

* Added a sketch of the interface of code completion consumer and code
  completion results.

Note: all this is not doing anything useful yet.


Swift SVN r6128
2013-07-10 20:53:40 +00:00
Dmitri Hrybenko
cb98234d67 Allow the parser to persist after parseIntoTranslationUnit() returns
Swift SVN r6102
2013-07-10 00:25:37 +00:00
Dmitri Hrybenko
7e7409ac2b Use nullptr instead of '0'.
Swift SVN r6069
2013-07-08 22:14:57 +00:00
Argyrios Kyrtzidis
6e7d0490f7 Allow optionally to produce comment tokens when lexing and add a tokenize() utility function.
Swift SVN r6008
2013-07-05 15:02:42 +00:00
Chris Lattner
20229fbf85 Introduce infrastructure for maintaining per-translation unit SIL parser state across
invocations of the parser.



Swift SVN r5906
2013-06-30 18:44:59 +00:00
Chris Lattner
cc3f22839a rework how autoimport happens. Instead of being driven by what the
source file imports in the first few lines, drive it based on the TU
mode.


Swift SVN r5751
2013-06-21 18:45:58 +00:00
Joe Groff
8693c5efaa SIL: Emit String-to-NSString conversions.
If -nsstring-is-string is enabled, lower Strings in cc(c) and cc(objc) function types to NSString, and when calling them, insert calls to StringToNSString/NSStringToString to perform the bridging conversion.

This isn't quite ready for prime-time yet, because we still need to emit the inverse bridging for ObjC method thunks, and I haven't tested the IRGen end of things yet.

Swift SVN r5355
2013-05-26 20:29:09 +00:00
Chris Lattner
8c85a49d2a with the groundwork out of the way, we can now namebind types referenced
by the SIL parser.  Add a test that covers both local types, and types
that require looking through an import decl (Int, from the stdlib).


Swift SVN r5249
2013-05-21 05:34:24 +00:00
Jordan Rose
6a0609d169 Use .swiftmodule instead of .sm for serialized modules.
We can bikeshed on this later, but for now we can use a very explicit
extension that has no chance of stepping on any existing extension.

Swift SVN r5239
2013-05-20 22:50:40 +00:00
Jordan Rose
476c4d4f48 [serialization] -emit-module: write out input file paths.
Eventually this will include both modules and source files that the
emitted module depends on, but for now it's just going to be used for
testing purposes to forward to normal source loaders.

Swift SVN r5108
2013-05-09 00:19:09 +00:00
Jordan Rose
5e5172fcf3 Add a skeleton for the Serialization library and -emit-module driver action.
WIP, doesn't do anything useful yet.

Swift SVN r5106
2013-05-08 23:29:51 +00:00
Chris Lattner
5b4c31dc94 reland r4968, with a bugfix to avoid breaking the lexer measuring token lengths.
Original message:
SIL Parsing: add plumbing to know when we're parsing a .sil file
Enhance the lexer to lex "sil" as a keyword in sil mode.


Swift SVN r4988
2013-04-30 00:28:37 +00:00
Chris Lattner
aafe3bdbdc revert r4968, it apparently breaks the world. I'll recommit it when I have time to investigate.
Swift SVN r4971
2013-04-29 16:58:43 +00:00
Chris Lattner
b503206bec SIL Parsing: add plumbing to know when we're parsing a .sil file
Enhance the lexer to lex "sil" as a keyword in sil mode.


Swift SVN r4970
2013-04-29 05:42:59 +00:00
Chris Lattner
2144140168 really use SIL IRGen for all recursive compilations as well, this exposes a symbol
redefinition (or linkage type) bug that causes two tests to fail.  I filed 
rdar://13670581 to track this and am plowing forward, since they seem minor.


Swift SVN r4761
2013-04-17 03:46:40 +00:00
Joe Groff
1a8b35d383 REPL: Support -sil-irgen.
Add a 'startElem' option to SILModule::constructSIL so that it can be used with REPL input.

Swift SVN r4519
2013-03-28 18:38:29 +00:00
Joe Groff
ddb7ead55c REPL: Contextual completions.
If the completion prefix has a '.' behind it, guesstimate a context expression by lexing backward through an identifier(.identifier)* dotted path, then attempt to parse and typecheck that expression to decide on a base type in which to find completions.

Swift SVN r4063
2013-02-16 20:07:50 +00:00
Joe Groff
aba47a6b90 Add a '-sil-emit-llvm' option to the driver.
It doesn't do anything but crash yet. Also add an entry point fo SILGen to Subsystems so that it can be invoked without dependency on SIL or SILGen.

Swift SVN r3738
2013-01-11 01:51:54 +00:00
Doug Gregor
9904844727 Move 'external definitions' vector into the Clang module; it only makes sense there.
Swift SVN r3367
2012-12-05 18:35:33 +00:00
Doug Gregor
42b1ab6fbd Introduce a LangOptions class to capture various type-checker-tweaking flags. For now, introduce bits to enable the constraint solver and to enable debugging of the constraint solver, and use those to eliminate the "useConstraintSolver" bit that was threaded through too much of the type checker.
Swift SVN r2836
2012-09-12 20:19:33 +00:00
Doug Gregor
0d7afbe5e0 Introduce an almost completely untested implementation of constraint
generation from an expression that has not been type-checked. One can
see the constraints introduced by an expression by using

  :dump_constraints <expression>

within the REPL. We're still missing several major pieces of
constraint generation:
  - We don't yet "open up" references to polymorphic types
  - We don't print out the child constraint systems in the dump, so
  it's not at all obvious what happens within overloading (and I'm not
  convinced I like my representation anyway)
  - There are no tests whatsoever
  - Member constraints are still very, very weird



Swift SVN r2624
2012-08-13 22:59:41 +00:00
Chris Lattner
32f529f1db Split arc-optimizer into two passes: arc-optimize and arc-expand.
This makes the two phases independently testable, but is also the
right thing to do: previously we'd form swift_retain early enough
that inlining would inline them from previously optimized callees
into callers, and this would block some mid-level optimizations
from doing nice things (because swift_retain isn't no-escape).

It's a small thing, but doing this allows us to eliminate a few 
more "and x, 9223372036854775807"'s from the stdlib.  We also
end up doing a lot less optimizations because we do them early
instead of only having the optimizations exposed after inlining
deeply.



Swift SVN r2114
2012-06-02 16:43:51 +00:00
Chris Lattner
bb92b747f9 make "swift -arc-optimize" actually run the arc optimizer.
Swift SVN r2075
2012-05-30 20:26:34 +00:00
Eli Friedman
dc213bca76 Implement basic REPL under swift -repl. Known demo-blockers: need error recovery, need better brace/paren handling, need to implement the "print" part of REPL.
Swift SVN r1452
2012-04-18 00:52:11 +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
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
d295d02c42 Initial interpreter implementation. The included pieces are enough to get the included simple.swift running in swift -i mode. <rdar://problem/10962290>, part 1.
Swift SVN r1319
2012-04-04 01:34:42 +00:00
Eli Friedman
29f3fca950 First iteration of CaptureAnalysis.
Swift SVN r1284
2012-03-29 00:24:03 +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
John McCall
c756d37afd Basic Component interface.
Swift SVN r911
2011-12-06 21:48:27 +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
d2ed4c2f3f remove some unneeded ASTContext arguments from subsystem entrypoints
now that it is reachable from TU


Swift SVN r815
2011-11-01 18:33:48 +00:00
John McCall
54ff2ccf4a Lop the last word off ModuleDecl and TranslationUnitDecl.
Swift SVN r693
2011-09-06 21:43:46 +00:00
John McCall
6cff7d48b6 Factor performIRGeneration into Subsystems.h.
Swift SVN r574
2011-08-20 01:10:23 +00:00
Chris Lattner
92051fd98e add a new Subsystems.h file to hold the entrypoints for various subsystems,
instead of smashing them into Parser.h, resolving some FIXME's.



Swift SVN r556
2011-08-13 22:43:17 +00:00