Commit Graph

6605 Commits

Author SHA1 Message Date
Chris Lattner
d6b01a42ad add a new (skeleton) pass for deshadowing inout variables.
Swift SVN r8954
2013-10-07 15:53:40 +00:00
Anna Zaks
a19d7569cc Introduce Builtin.staticReport, which allows compiler diagnostic reporting.
- Introduces the Builtin
- If the first parameter evaluates to '1', the dataflow diagnostics pass produces a diagnostic.
- The Builtin gets cleaned up before IRGen, but not before SIL serialization.

This patch also removes the current, overflow warning and XFAILs one of the tests. The other test is switched to use Builtin.staticReport.

TODO:
 - Utilize the other parameters to the builtin - the Message and IsError flag.
 - Use this Builtin within the stdlib.

Swift SVN r8939
2013-10-05 00:12:23 +00:00
Chris Lattner
767da738bb Change the command line option to sil-opt for the definite initialization
pass to be -definite-init instead of -memory-promotion, rename the
entrypoint for the pass to match, and tidy various and sundry comments.


Swift SVN r8927
2013-10-04 18:45:09 +00:00
Joe Groff
bea03d27f4 Bring back frame pointers.
The backend team needs them for performance analysis.

Swift SVN r8791
2013-09-30 20:29:18 +00:00
Joe Groff
82a18333ed SIL: Purge SpecializeInst.
Make ApplyInst and PartialApplyInst directly take substitutions for generic functions instead of trying to stage out substitutions separately. The legacy reasons for doing this are gone.

Swift SVN r8747
2013-09-28 00:15:45 +00:00
Michael Gottesman
2074b8ad74 Add support to the swift driver for running SIL Optimization Passes when the optimization level is > 0.
Swift SVN r8703
2013-09-26 21:58:45 +00:00
Jordan Rose
15bfc8db2b Don't type-check imported decls unless referenced in the source file.
Instead, pass a LazyResolver down through name lookup, and type-check
things on demand. Most of the churn here is simply passing that extra
LazyResolver parameter through.

This doesn't actually work yet; the later commits will fix this.

Swift SVN r8643
2013-09-25 20:08:14 +00:00
Chris Lattner
d5314e7d28 rearrange REPL's SIL/IRGen path so that sil diagnostics are recovered from
the same way as sema diagnostics.  This fixes:
<rdar://problem/15000923> REPL exits if you declare something without initializing it


Swift SVN r8548
2013-09-21 21:54:55 +00:00
Greg Parker
90827fff8a Honor environment variable SDKROOT.
Swift SVN r8524
2013-09-20 22:58:36 +00:00
Greg Parker
485ed71b86 Rename SWIFT_SDK to MODULES_SDK in make to match cmake.
Swift SVN r8386
2013-09-18 02:26:18 +00:00
Greg Parker
0da2b85241 Embed the same SDK path in swift-ide-test as in swift itself.
Swift SVN r8248
2013-09-14 10:06:12 +00:00
Greg Parker
8e13188209 Consolidate some build flags for .swift files. Add cross-compilation support.
Swift SVN r8181
2013-09-13 01:51:48 +00:00
Chris Lattner
7c8ae9352a Add a new "mark_function_escape" instruction that will be used to mark the
escape point of function definitions that "close" over global variables.



Swift SVN r8152
2013-09-12 18:31:00 +00:00
Anna Zaks
992e95ee0c Add -emit-verbose-sil argument to sil-opt.
Swift SVN r8107
2013-09-11 20:54:28 +00:00
Mark Lacey
a558acc86a Update the SIL stage at the end of the canonicalization phase.
Swift SVN r8067
2013-09-10 00:29:00 +00:00
Chris Lattner
d9a6827122 revert this, I didn't mean to commit it.
Swift SVN r8046
2013-09-09 18:15:31 +00:00
Chris Lattner
e48b3a4702 Rework how capture lists work in CaptureExpr: now we record
global variables used by functions in the capture list as well.

SILGen and other things that don't care about these (i.e., all 
current current clients) filter the list to get what they want.

This is needed for future definite init improvements, and unblocked
by Doug's patch in r8039 (thanks! :)

No functionality change.



Swift SVN r8045
2013-09-09 18:15:07 +00:00
Adrian Prantl
d7c64060cf Debug info: Don't copy the memory for a serialized swift module in an __ast
section. Thanks to Jordan for pointing this out.
No functionality change.

Swift SVN r8022
2013-09-07 00:44:32 +00:00
Adrian Prantl
e77baa78b7 Rename __DWARF/__apple_ast segment and section to __SWIFT/__ast so the
linker doesn't discard it.

Swift SVN r7958
2013-09-05 20:46:34 +00:00
Chris Lattner
dea8213ef9 remove the -enable-definite-init command line option. Definite init
seems to have stuck.


Swift SVN r7956
2013-09-05 20:37:41 +00:00
Adrian Prantl
2063a27aea Relocate Mach-O AST section parsing from SerializedModuleLoader/ to ASTSectionImporter/.
Swift SVN r7869
2013-09-03 21:56:53 +00:00
Dave Abrahams
820e05a784 [tools] gyb: Add two missing Python "dedent keywords"
Swift SVN r7864
2013-09-03 21:07:34 +00:00
Adrian Prantl
e216617f30 Use portable LLVM header instead of Darwin header.
Swift SVN r7857
2013-09-03 20:14:43 +00:00
Adrian Prantl
d929050173 Implement SerializedModuleLoader::addASTSection() to parse AST sections as
created by IrGen/SwiftASTStreamerPass.

Swift SVN r7851
2013-09-03 18:09:53 +00:00
Adrian Prantl
f12eca77ea change formatting.
Swift SVN r7772
2013-08-30 00:26:34 +00:00
Adrian Prantl
1da2dc442e s/Bitstream/MemoryBuffer/g
Swift SVN r7770
2013-08-30 00:22:27 +00:00
Dave Abrahams
40d3f9e022 [stdlib] Add "gyb" templating engine; use it to generate FixedPoint.swift
Eventually gyb should be integrated with the build system, but for now
we are only using it to generate one Swift file.

Swift SVN r7759
2013-08-29 22:57:09 +00:00
Dmitri Hrybenko
0d157c8d4c Prune unused includes
Swift SVN r7730
2013-08-29 20:06:25 +00:00
Dmitri Hrybenko
ea41db75e7 lldb-moduleimport-test: replace VLA of char with SmallString,
replace iostream with llvm::{outs, errs}


Swift SVN r7729
2013-08-29 18:59:14 +00:00
Dmitri Hrybenko
4ca448273a lldb-moduleimport-test: no-op whitespace fixes
Swift SVN r7727
2013-08-29 18:46:56 +00:00
John McCall
f11057cf02 Fix for Makefile builds.
Swift SVN r7721
2013-08-29 06:47:18 +00:00
Adrian Prantl
31c926660f Extend SerializedModuleLoader to load modules from a bitstream.
Add tools/lldb-moduleimport-test, which simulates LLDB importing modules
from the __apple_ast section in Mach-O files and use it to regression-test
the new API.

Swift SVN r7709
2013-08-29 00:57:05 +00:00
Stephen Lin
a0f44d50b2 Update remaining references to [force_inline] to [transparent]
Swift SVN r7627
2013-08-27 18:46:03 +00:00
Jordan Rose
eef39ff914 Add a :print_module directive to the REPL.
This is basically the same as doing a :print_decl on every decl in the module,
except that it does not print extensions that come from other modules, and
/does/ print extensions and operators that come from this module.

Does not yet work for Clang modules or the Builtin module.

Swift SVN r7601
2013-08-26 23:07:51 +00:00
Jordan Rose
3e992a64fa Use -module-link-name to encode library names in standard library modules.
...which allows us to drop the hardcoded logic to load specific libraries
in immediate modes.

Swift SVN r7585
2013-08-26 18:57:50 +00:00
Jordan Rose
920253877c Fix autolinking for libraries in immediate modes.
...and fall back to looking in the Swift runtime directory if dyld's
default lookup fails.

Swift SVN r7584
2013-08-26 18:57:49 +00:00
Chris Lattner
80cb2021d2 teach the repl to run SIL diagnostic passes too, which is required for correctness
with the new definite init model (well, it always is, but not IRGen explodes if
they aren't run instead of just producing broken code).

This is also a step towards rdar://14819740


Swift SVN r7575
2013-08-26 16:48:31 +00:00
Chris Lattner
af1a8205b8 rename tools/swift/Frontend.{h|cpp} -> Helpers.{h|cpp} to avoid hopelessly
confusing me with the Frontend library.  Add some more include guards around
the real Frontend.h header.


Swift SVN r7570
2013-08-26 16:08:34 +00:00
Chris Lattner
0c8deef48a move the list of sil diagnostic passes out to a "runSILDiagnosticPasses"
helper function which is shared by the compiler and the immediate mode
stuff.  This way, diagnostic passes are run on modules imported by "-i".

Also add include guards and clean up headers a lot.


Swift SVN r7568
2013-08-26 16:06:37 +00:00
Chris Lattner
41ea6ac780 refactor the interface to RunImmediately to pass down the CompilerInstance,
instead of a few parts of it.  No functionality change.


Swift SVN r7567
2013-08-26 15:50:31 +00:00
Jordan Rose
7d6d336983 Add autolinking infrastructure to Module and ClangImporter.
...and use it to load frameworks and libraries in immediate modes (-i and
the REPL), replacing a walk of visible modules that checked if any imported
modules were Clang modules.

Swift SVN r7488
2013-08-22 23:20:23 +00:00
Chris Lattner
e1855fd3a5 move SIL verification logic to SIL/Verifier.cpp and change
sil-opt to run the verifier after every sil pass it runs.


Swift SVN r7477
2013-08-22 21:27:19 +00:00
Argyrios Kyrtzidis
ae65ab1ee0 Introduce NullClangImporter library which is for clients that don't want to link Clang.
ClangImporter::create had a 'weak' attribute but it did not actually have the desired effect,
static libraries still want to link to ClangImporter::create if it is used.
Avoiding linking ClangImporter kinda "worked" because CompilerInvocation::setSDKPath was inline,
so if you didn't call it then you didn't need to link to Clang importer, but that is avoiding
ClangImporter statically, not dynamically.
You could see this by moving CompilerInvocation::setSDKPath out-of-line and then sil-opt would fail to link.

In order to have clients avoiding linking Clang, introduce NullClangImporter which just returns null for the
ClangImporter constructor function.

Swift SVN r7465
2013-08-22 18:29:58 +00:00
Michael Gottesman
b75d5003fa Fixed 2x instances where we were missing C++ editor identifiers on .h files and a mislabeled header file.
Swift SVN r7418
2013-08-21 19:28:45 +00:00
Jordan Rose
b1ef55936b Use Module::forAllVisibleModules to decide what libraries we need to link in.
This ensures that libSwiftAppKit.dylib gets loaded if we import Cocoa.
It's not perfect because we really should process /all/ modules, not just
visible modules...but it does fix <rdar://problem/14716017>. The long-term
fix is proper autolinking.

Swift SVN r7304
2013-08-16 23:32:50 +00:00
Stephen Lin
8d90466523 Reorganize SIL source tree: move lib/SIL/SILGen -> lib/SILGen, move lib/SIL/Passes -> lib/SILPasses, add lib/SILPasses/Utils
Swift SVN r7246
2013-08-14 23:47:29 +00:00
Stephen Lin
12e9086893 Initial implementation of mandatory inlining pass; non-recursive inlining, single basic blocks, no diagnosis of circular inlining
Swift SVN r7241
2013-08-14 22:30:20 +00:00
Doug Gregor
3c4fc9e34a Fix REPL commands (e.g., :print_decl), which were totally broken.
Swift SVN r7215
2013-08-13 23:37:15 +00:00
Anna Zaks
342dff1c80 [SIL CCP] Add the early constant propagation pass skeleton.
The pass folds a single operation: int_sadd_with_overflow and issues an
error on detectable overflow.

Swift SVN r7204
2013-08-13 17:36:35 +00:00
Dmitri Hrybenko
70f2b64ad9 Add CharSourceRange -- a half-open character range, which will be used in IDE
integration

Motivation: libIDE clients should be simple, and they should not have to
translate token-based SourceRanges to character locations.

This also allows us to remove the dependency of DiagnosticConsumer on the
Lexer.  Now the DiagnosticEngine translates the diagnostics to CharSourceRanges
and passes character-based ranges to the DiagnosticConsumer.


Swift SVN r7173
2013-08-12 20:15:51 +00:00