Commit Graph

195 Commits

Author SHA1 Message Date
Adrian Prantl
adfdd7edc6 typo.
Swift SVN r6811
2013-08-01 18:47:40 +00:00
Chris Lattner
11f5b48a27 Fix a -Wdocumentation warning, and hack out NoFramePointerElimNonLeaf to
fix the build.  This isn't a proper fix (we should start putting out new attributes
on llvm::Function's, but getting the build working again seems important.


Swift SVN r6584
2013-07-25 03:41:57 +00:00
Jordan Rose
6547b9790a [serialization] Allow references to Clang-imported values.
This unfortunately duplicates the hack of directly referencing the Clang
module loader if a cross-reference points to the current module; ideally
we'd have some kind of module chain, but I'd settle for a refactoring of
the code to share with NameBinding.

Additionally, Clang nodes are not actually validated to be from the right
module, which could be problematic for extensions or any case of actual
name collision.

Swift SVN r6519
2013-07-23 23:10:05 +00:00
Jordan Rose
b17a23112e Revert "Update for LLVM change to raw_fd_ostream's option flags."
I'm not sure what I was thinking. Thanks for actually fixing this, Sean.

This reverts r6503.

Swift SVN r6307
2013-07-16 23:16:05 +00:00
Jordan Rose
0a6d9df178 Update for LLVM change to raw_fd_ostream's option flags.
Swift SVN r6305
2013-07-16 23:11:03 +00:00
Sean Callanan
213829f946 Adapted to a changed enum in llvm to make the build
work again.


Swift SVN r6300
2013-07-16 23:01:14 +00:00
Adrian Prantl
68e1df49f5 Fix a couple more glitches that were uncovered by assertions.
Swift SVN r5774
2013-06-23 03:35:28 +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
24a092bc3a IRGen: Use 'generic' cpu target.
LLVM recently changed to autodetect host features by default. Change our default to use the "generic" CPU so that we emit binaries to a portable baseline (until some time in the future when we have proper -mtune and -mattr flags).

Swift SVN r4310
2013-03-06 23:59:18 +00:00
Joe Groff
c9d6a351f5 IRGen: SIL ClosureInsts (almost).
Implement lowering of SIL ClosureInsts by packing the partial arguments into a heap allocation and emitting a thunk to unpack them and apply the closure function, similar to curried entry points. The test doesn't work quite yet because nested FuncDecls don't get visited anymore. I need to replace my hacked SIL path with a proper walk of the SIL module to generate functions and the AST to generate types.

Swift SVN r3817
2013-01-20 19:50:10 +00:00
Joe Groff
9259c0d912 IRGen: Get "hello world" to compile through SIL.
Add a path through IRGenModule to optionally codegen FuncDecls using their corresponding SIL Functions when constructed with a SILModule. Jury-rig an IRGenSILFunction subclass of IRGenFunction that does the bare minimum necessary to compile "hello world" from SIL. There are some impedance mismatches between irgen and SIL that need to be smoothed out, particularly the AST-dependent way irgen currently handles function calls. Nonetheless, `swift -sil-i hello.swift` works!

Swift SVN r3759
2013-01-14 02:57:11 +00:00
Dave Zarzycki
ed5de91828 Fix build warnings
Swift SVN r3749
2013-01-11 18:58:44 +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
Chris Lattner
47dbc4051c update for mainline LLVM header file moves.
Swift SVN r3634
2013-01-02 14:38:42 +00:00
Doug Gregor
83f2874ba1 Implement support for calling imported C functions from Swift.
There is no protection whatsoever if the Clang-to-Swift type
conversion produces something that Swift doesn't lower in an
ABI-compatible way. That will be dealt with later.


Swift SVN r3249
2012-11-27 00:34:48 +00:00
Eli Friedman
a9f685d94b Fix my crazy swift.swift inlining hack so it doesn't pull in llvm.global_ctors. <rdar://problem/12539597>.
Swift SVN r3032
2012-10-20 00:01:26 +00:00
Eli Friedman
dd299a35af Fix for LLVM TargetData -> DataLayout rename.
Swift SVN r2959
2012-10-09 23:18:24 +00:00
Eli Friedman
519a683557 Shuffle around code to avoid a crash after IRGen errors.
Swift SVN r2510
2012-08-02 21:51:19 +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
Eli Friedman
e2bfb30772 Add a verifier pass at the end of the optimization pipeline, to catch bugs in the ARC optimizer etc.
Swift SVN r2073
2012-05-30 18:47:41 +00:00
Chris Lattner
d1487a3ede Scaffolding for ARC optimizer pass.
Swift SVN r2027
2012-05-28 00:04:29 +00:00
Eli Friedman
28cddd1b90 Make sure we use the right IR generation options for the IRGen standard library hack.
Swift SVN r1801
2012-05-10 22:22:18 +00:00
Eli Friedman
8f290b63a8 Extend the ugly standard library hack so it works for static compilation. We should be inlining from the standard library now everywhere except the REPL.
Swift SVN r1792
2012-05-10 01:14:56 +00:00
Chris Lattner
204b416229 raw_fd_ostream doesn't set the "has_error" bit in its ctor if it failed to open the file, it returns the error through the string reference error argument. This is half of fixing rdar://11388418.
The other half is on the llvm side.


Swift SVN r1761
2012-05-06 16:19:26 +00:00
Eli Friedman
ca1f3270bc A couple minor tweaks to IRGen: turn on inlining when we're optimizing, and turn off non-leaf frame pointer elimination when we're generating an object file.
Swift SVN r1749
2012-05-05 02:16:07 +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
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
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
7568876781 update for mainline api change.
Swift SVN r895
2011-12-05 22:52:50 +00:00
John McCall
2a4352b4ca Fix the build for LLVM API changes.
Swift SVN r869
2011-11-16 19:30:31 +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
Chris Lattner
9298082ebb move Diagnostics header to include/swift/AST to match .cpp files.
Swift SVN r782
2011-10-22 00:47:35 +00:00
Chris Lattner
dfd529ce3a rename diags::foo to diag::foo
Swift SVN r779
2011-10-22 00:36:19 +00:00
Chris Lattner
f92f616aaf remove hte ASTContext::hadError bool.
Swift SVN r778
2011-10-22 00:32:39 +00:00
Chris Lattner
5e8370dea0 eliminate some printouts from IRGen in favor of real diagnostics.
Swift SVN r777
2011-10-22 00:32:14 +00:00
John McCall
b6f312aea0 Verification should clearly follow each phase rather than coming
at the start of the next phase.



Swift SVN r731
2011-09-24 09:32:18 +00:00
John McCall
5fddb24ddc Basic verifier framework.
Swift SVN r728
2011-09-23 23:50:02 +00:00
John McCall
54ff2ccf4a Lop the last word off ModuleDecl and TranslationUnitDecl.
Swift SVN r693
2011-09-06 21:43:46 +00:00
Doug Gregor
67bcc9fac1 Some headers have moved around in LLVM; update to their new locations.
Swift SVN r637
2011-08-29 19:57:33 +00:00
John McCall
6cff7d48b6 Factor performIRGeneration into Subsystems.h.
Swift SVN r574
2011-08-20 01:10:23 +00:00
John McCall
15922d77b4 Go ahead and support outputting to .ll, .bc, .s, and .o.
Swift SVN r546
2011-08-13 22:01:51 +00:00
John McCall
42449b02bb Massively slow down link times by uselessly emitting empty modules.
Swift SVN r538
2011-08-13 07:40:45 +00:00
John McCall
bca041368d Structure for IR generation.
Swift SVN r537
2011-08-13 05:37:06 +00:00