Commit Graph

598 Commits

Author SHA1 Message Date
Jordan Rose
d52edd8675 Add -I and -F support to lldb-moduleimport-test.
Swift SVN r15751
2014-04-01 21:47:36 +00:00
Michael Gottesman
4e73547a3e Change SerializedSILLoader::create to return a unique_ptr and use that everywhere so we don't leak SILLoaders.
Swift SVN r15700
2014-03-31 22:57:03 +00:00
Michael Gottesman
0727628c8c [deserialization] Add in the linker pass.
Swift SVN r15671
2014-03-31 08:40:36 +00:00
Nadav Rotem
5500bdae22 Add a command line flag for removing cond_fails in SIL.
Swift SVN r15432
2014-03-25 00:51:01 +00:00
Michael Gottesman
5b88963e78 [SIL] Implement external SIL Witness Table declarations.
This will help with ensuring that we do not create multiple witness
table "definitions" one of which is null. That situtation yields an
IRGen assertion to be hit since the external declaration (in the guise
of a definition) has a different type from the actual deserialized
definition.

Swift SVN r14999
2014-03-13 19:52:59 +00:00
Jordan Rose
49ec7c1ea1 Use SWIFT_MODULE_CACHE_PATH for all tools.
Now that the standard library depends on Clang headers, every single tool
needs to specifically avoid using the default module cache when
SWIFT_MODULE_CACHE_PATH is set.

<rdar://problem/16294222>

Swift SVN r14937
2014-03-12 00:27:24 +00:00
Jordan Rose
a440870268 Drop the swift_driver alias for 'swift'.
Swift SVN r14936
2014-03-12 00:27:19 +00:00
Dmitri Hrybenko
e50b52fa02 Serializer/Driver: serialize comments to separate .swiftdoc files
The driver infers the filename from the module file by replacing the extension,
and passes the explicit path to the swiftdoc file to the frontend.  But there
is no option in the driver to control emission of swiftdoc (it is always
emitted, and name is always inferred from the swiftmodule name).

The swiftdoc file consists of a single table that maps USRs to {brief comment,
raw comment}.  In order to look up a comment for decl we generate the USR
first.  We hope that the performance hit will not be that bad, because most
declarations come from Clang.  The advantage of this design is that the
swiftdoc file is not locked to the swiftmodule file, and can be updated,
replaced, and even localized.


Swift SVN r14914
2014-03-11 10:42:26 +00:00
Jordan Rose
7b0d4793f6 Add the real ClangImporter as a dependency for sil-extract and sil-opt.
The standard library is about to start using some C/Objective-C
declarations internally, which means every tool needs to be import
C/Objective-C. (Don't worry, they're keeping it small.)

Apologies for your link times.

(The NullClangImporter is dead; I'll remove it next week.)

Swift SVN r14821
2014-03-08 02:37:28 +00:00
Dmitri Hrybenko
255b8e88c8 Fix a leak that I introduced in r14729: FrontendOptions does not own input
buffers, so undo 'unique_ptr'fication here


Swift SVN r14733
2014-03-06 13:53:04 +00:00
Dmitri Hrybenko
f232267f23 Replace llvm::OwningPtr with std::unique_ptr
It looks like llvm::OwningPtr is going to be removed soon.


Swift SVN r14729
2014-03-06 09:47:17 +00:00
Chris Lattner
8869767260 Implement the rest of rdar://16242700
Fix a phase ordering problem: SILGen of a noreturn function doesn't drop an unreachable after the function,
and doing so is problematic for various reasons (all expressions would have to handle their insertion point
vaporizing, and would have to emit unreachable code diagnostics).  Instead, run a simple pass that folds
noreturn calls and diagnoses unreachable code, and do it before DI.  This prevents DI from seeing false
paths, and rejecting what seems like invalid code.



Swift SVN r14711
2014-03-06 01:29:32 +00:00
Doug Gregor
56368f87dc Put the SwiftARCPasses dylib in the right place.
Swift SVN r14600
2014-03-03 18:47:08 +00:00
Michael Gottesman
3293184b2e Don't link llvm statically into libswiftOptimizeARC.a. Actually link libswiftOptimizeARC.a into SwiftARCPasses.dylib.
This patch fixes a number of issues:

1. We were not linking libswiftOptimizeARC.a into SwiftARCPasses.dylib.
2. If you did perform that linking since libswiftOptimizeARC.a had a bunch of
llvm statically linked into it, opt would see multiple instances of certain
options causing it to error out.

Now we don't statically link in a ton of LLVM into libswiftOptimizeARC.a and
properly link libswiftOptimizeARC.a into SwiftARCPasses.dylib.

Swift SVN r14557
2014-03-01 06:31:54 +00:00
Jordan Rose
d0df0cff82 [CMake] Revert SwiftARCPasses back to add_llvm_loadable_module.
This is necessary to not link in a duplicate copy of LLVMSupport. This is
the same interface as LLVM's example modules and Clang's sample plug-ins.

Fariborz, if this breaks your Xcode setup again, please let me know and I'll
come take a look. (The Clang targets work fine for me in Xcode.)

Swift SVN r14547
2014-03-01 00:44:14 +00:00
Michael Gottesman
c25d6f8390 [mandatory-inlining] Use getOptions() instead of passing around options.
Swift SVN r14493
2014-02-28 01:51:53 +00:00
Michael Gottesman
29e1a53bbb [deserialization] Deserialize transparent functions lazily iff they will be used in mandatory inlining.
Swift SVN r14490
2014-02-28 01:05:01 +00:00
Michael Gottesman
3ac5018ac9 Revert "Revert r14430: Create two SILLinking steps, one before Diagnostics for transparent functions and the other after Diagnostics for non transparent functions if -sil-link-all is passed in."
This recommits r14446 with necessary changes.

The problem was that after my change SILGen was dumped before sil linking
occured. This change adds back in the code to ensure that sil linking occurs.

Swift SVN r14455
2014-02-27 07:04:51 +00:00
Dave Zarzycki
ce2635d401 Revert r14430: Create two SILLinking steps, one before Diagnostics for transparent functions and the other after Diagnostics for non transparent functions if -sil-link-all is passed in.
Swift SVN r14446
2014-02-27 03:09:55 +00:00
Michael Gottesman
0c755a55a8 Create two SILLinking steps, one before Diagnostics for transparent functions and the other after Diagnostics for non transparent functions if -sil-link-all is passed in.
Swift SVN r14430
2014-02-26 23:47:50 +00:00
Ted Kremenek
028f9d0561 Remove rest of Makefile build except for 'docs' and 'www'.
For 'docs' and 'www' it is possible these are still being used,
as they work independent of the Makefile build.  Keeping them for now.

Swift SVN r14418
2014-02-26 22:21:25 +00:00
Jordan Rose
bb0a65483c Remove swift_old.
Long live the driver!

Swift SVN r14328
2014-02-25 00:47:41 +00:00
Dmitri Hrybenko
73aa816935 Track upstream change in raw_fd_ostream API
The default (F_None) used to mean F_Text, now it is F_Binary, which is arguably
a better default.  It only matters on Windows anyway, so just use F_None (to
mean binary mode) everywhere to allow Swift to be compled with older LLVM as
well as current ToT.


Swift SVN r14312
2014-02-24 21:00:00 +00:00
Dmitri Hrybenko
fef36edc6b Try to fix the build following the LLVM raw_fd_ostream API change
Swift SVN r14304
2014-02-24 17:21:49 +00:00
Argyrios Kyrtzidis
bb4b57c053 [IDE] Introduce ide::printDeclUSR() which uses the mangler to provide a USR for a swift symbol.
Swift SVN r14279
2014-02-23 06:54:48 +00:00
Argyrios Kyrtzidis
8cb03b5cdf [CMake] Use add_swift_library() for SwiftARCPasses targets.
This makes it consistent with the rest of the swift targets and addresses rdar://16030128

Swift SVN r14277
2014-02-23 01:10:43 +00:00
Michael Gottesman
ba7dfd054a [sil-extract] Teach SILExtract how to deserialize SIL from swift modules like SILOpt.
Now sil-extract can be used on the stdlib (when we can deserialize it).

Swift SVN r14251
2014-02-22 04:11:02 +00:00
Michael Gottesman
456cd2bfb9 [sil-dis] Remove sil-dis now that its functionality is integrated into sil-opt.
Swift SVN r14239
2014-02-21 23:16:07 +00:00
Michael Gottesman
3a784587f7 [sil-opt] Teach SILOpt how to process module files.
I will be removing sil-dis in a forthcoming commit.

Swift SVN r14236
2014-02-21 23:01:13 +00:00
Michael Gottesman
8ddba95459 [sil-opt] Dump decls as well as SIL.
Swift SVN r14235
2014-02-21 23:01:13 +00:00
Michael Gottesman
2bc8e3e3ed Remove trailing whitespace. NFC.
Swift SVN r14215
2014-02-21 18:33:48 +00:00
Michael Gottesman
1300677b3f [sil-opt] Remove cruft code that was supposed to call the verifier after every
pass and instead was calling the verifier after adding every pass to the pass
manager (i.e. just wasting cpu time). Instead enable sil-verify-all by default
to get the same effect.

Swift SVN r14213
2014-02-21 18:29:32 +00:00
Michael Gottesman
e35f93a551 [sil-opt] Declare PassKind in an anonymous namespace instead of the global scope.
Swift SVN r14212
2014-02-21 18:29:32 +00:00
Michael Gottesman
903d4e85a3 [sil-opt] Change banner description to something actually descriptive.
Swift SVN r14211
2014-02-21 18:21:37 +00:00
Michael Gottesman
682530209b Fix typo = /. NFC.
Swift SVN r14193
2014-02-21 00:49:21 +00:00
Michael Gottesman
9c3b1fe38e Somehow this header got messed up = /. Fix it quick.
Swift SVN r14192
2014-02-21 00:46:12 +00:00
Michael Gottesman
0f45dbb8e7 A few small cleanups from onlist review by Jordan and my own review of the code.
The most interesting one is that the sil-dis test is modified to not run IRGen
which should lower the amount of time to run the test.

Swift SVN r14190
2014-02-21 00:44:05 +00:00
Michael Gottesman
c775782755 [sil-dis] Initial commit of sil deserialization utility "sil-dis".
Currently supports dumping decls and SILModules from the standard library only.
This restriction is good enough for my purposes of verification of the
deserialization of SIL and allows me to ignore the complexity of having multiple
source files (which not being the stdlib implies most of the time).

Swift SVN r14187
2014-02-21 00:24:35 +00:00
Nadav Rotem
d52cbc89dd Rename AllocRefElim -> DeadObjectElim. NFC.
Swift SVN r14179
2014-02-20 23:14:59 +00:00
Jordan Rose
eeda180d81 [PrintAsObjC] Emit the ObjC header after SILGen...
...because doing so might cause more Clang types to be deserialized, which
before led to trying to SILGen un-type-checked auto-generated helpers.

Swift SVN r14017
2014-02-18 00:23:12 +00:00
Jordan Rose
69d849772b Always honor -dump-parse, -dump-ast, or -print-ast even if there were errors.
...though -print-ast seems a bit broken right now.

<rdar://problem/16084143>

Swift SVN r14000
2014-02-17 18:48:09 +00:00
Jordan Rose
0f54c34053 Use -resource-dir for iOS builds and tests instead of -I.
As part of this, have the standard library target be responsible for
symlinking Clang's headers into the resource directory, instead of the
compiler target. This makes sure the headers show up in all copies of
the build directory.

This brings our iOS testing closer to what Xcode will do, which will
hopefully avoid issues like <rdar://problem/16052579>.

Swift SVN r13890
2014-02-14 01:27:16 +00:00
Jordan Rose
93b87edcbe Add -resource-dir option to find lib/swift directory.
This is equivalent to Clang's -fresource-dir; it provides the location of
compiler modules and libraries.

No end-user-visible changes, but the iOS build will no longer have to use
-I to build and test its own standard libraries.

Swift SVN r13888
2014-02-14 01:27:15 +00:00
Joe Groff
5340cec561 Add 'swift' back to the installation package.
Swift SVN r13863
2014-02-13 07:53:36 +00:00
Jordan Rose
f880250ea3 [Makefiles] Add missing dependency: swift_driver needs the PrintAsObjC library.
Should fix the LLDB build.

Swift SVN r13831
2014-02-12 18:25:52 +00:00
Jordan Rose
657565da73 [CMake] Eliminate SWIFT_NEW_DRIVER; everyone should be using the new driver.
swift_old will stick around for another week at least for A/B testing.
After that, "swift -frontend" will handle the low-level stuff, and
"swift -force-single-frontend-invocation" will do a high-level build
in the style of swift_old.

Swift SVN r13804
2014-02-12 01:43:56 +00:00
Jordan Rose
16f8ece6e6 Drop -print-as-objc from swift-ide-test.
Use "swift -emit-objc-header" (or "swift -emit-objc-header-path output.h")
instead.

Swift SVN r13802
2014-02-12 01:19:14 +00:00
Jordan Rose
c054bea3e4 [PrintAsObjC] Actually call printAsObjC when we pass -emit-objc-header.
Switch the existing tests over to using this.

Swift SVN r13801
2014-02-12 01:19:14 +00:00
Jordan Rose
95461797aa Move -print-as-objc feature into a library.
No functionality change.

Swift SVN r13798
2014-02-12 01:19:09 +00:00
Michael Gottesman
8cff098f1e Split SILCodeMotion into two passes, LoadStoreOpts and SILCodeMotion.
LoadStoreOpts removes duplicate loads, forwards stores to loads, and eliminates
dead stores.

Swift SVN r13789
2014-02-11 23:36:51 +00:00