Commit Graph

176 Commits

Author SHA1 Message Date
Adrian Prantl
0de0d43773 Introduce a -modulewrap driver action that wraps a (merged) .swiftmodule
inside a swift ast section in an object file so it can be passed to the
linker. The driver automatically wraps merged swiftmodules iff the target
is ELF.

rdar://problem/22407666

Swift SVN r31641
2015-09-02 21:56:25 +00:00
Jordan Rose
de2ecbb80e [Driver] Remove the notion of Tools, turn ToolChain into an Action visitor.
The "Tool" abstraction wasn't buying us enough to deserve the added
complexity. Now a ToolChain turns Actions into Jobs, and every helper
tool is searched for relative to Swift first. Much simpler.

Swift SVN r31563
2015-08-28 23:12:33 +00:00
Doug Gregor
561d5fd4a9 Add an opt-in warning to complain about needless words in declarations.
The new option -Womit-needless-words finds places where names are
redundant with type information, producing warnings and Fix-Its to
shorten the names. Part of rdar://problem/22232287, to help bring
the same heuristics we're applying in the Clang importer to the user's
Swift code.

Swift SVN r31234
2015-08-13 23:39:35 +00:00
Doug Gregor
284d8e52cf Introduce an option to omit needless words when importing from Clang.
The -enable-omit-needless-words option attempts to omit needless words
from method names imported from Clang. Broadly speaking, a word is
needless if it merely restates the type of the corresponding parameter,
using reverse camel-case matching of the type name to the
function/parameter name. The word "With" is also considered needless
if whether follows it is needless, e.g.,

  func copyWithZone(zone: NSZone)

gets reduced to

  func copy(zone: NSZone)

because "Zone" merely restates type information and the remaining,
trailing "With" is also needless.

There are some special type naming rules for builtin Objective-C types,
e.g.,

  id -> "Object"
  SEL -> "Selector"
  Block pointer types -> "Block"

as well as some very-Cocoa-specific matching rules, e.g., the type
"IndexSet" matches the name "Indexes" or "Indices".

Expect a lot of churn with these heuristics; this is part of
rdar://problem/22232287.

Swift SVN r31178
2015-08-12 18:21:45 +00:00
Chris Lattner
0001dc27bb remove support for the experiemental "character literals" feature.
Swift SVN r30509
2015-07-22 22:35:19 +00:00
Jordan Rose
963c442b44 [Driver] Add support for interface-hash.
Dependents of modified files are no longer rebuilt by default, only if it turns
out that file's interface has changed. There is a flag
-driver-always-rebuild-dependents to override this, but we expect it to only be
used for testing. (Most of the existing dependency tests pick up this option;
the two new tests have "interface-hash" in the name.)

This is the second half of ChrisW's work on interface hashing.

rdar://problem/15352929

Swift SVN r30478
2015-07-22 00:14:01 +00:00
Jordan Rose
fbb8d3f9a8 Add "interface hash" for improved incremental builds.
Compute the hash of all interface tokens when parsing; write the
interface hash to the swiftdeps file, or if the -dump-interface-hash
option is passed to the frontend. This hash will be used in incremental
mode to determine whether a file's interface has changed, and therefore
whether dependent files need to be rebuilt in response to the change.

Committed on ChrisW's behalf while he gets his setup unborked.

rdar://problem/15352929

Swift SVN r30477
2015-07-22 00:13:54 +00:00
Devin Coughlin
ea18bc0c0b Rename -dump-trc option to -dump-type-refinement-contexts
As Jordan notes, 'TRC' is not a commonly-known acronym for most Swift compiler developers.

Swift SVN r30414
2015-07-20 21:47:49 +00:00
Devin Coughlin
b1adbe0d38 Remove unused -enable-availability-checking-in-implicit-functions frontend flag
This was for staging in functionality that is now always on.

Swift SVN r30384
2015-07-19 07:58:05 +00:00
Devin Coughlin
b427975c39 Add a -dump-trc frontend option to print the type refinement context hierarchy
This is useful for debugging and testing.

Swift SVN r30383
2015-07-19 05:53:27 +00:00
Devin Coughlin
c1caddae62 Remove experimental support for treating unavailable symbols as optional.
This has always been off by default and is a language direction we have decided not to
pursue.

Swift SVN r30355
2015-07-18 01:56:25 +00:00
Jordan Rose
45189f9feb [Driver] Add a basic tracing mode to determine why files are getting rebuilt.
Enabled with -driver-show-incremental. For debugging purposes only.

Swift SVN r29804
2015-06-30 19:31:07 +00:00
Joe Groff
bc55c4ef37 ClangImporter: Remove -enable-simd-import staging option.
Swift SVN r29765
2015-06-27 18:10:25 +00:00
Joe Groff
55a830df38 ClangImporter: Remove -enable-c-function-pointers staging option.
Swift SVN r29764
2015-06-27 18:10:21 +00:00
Joe Groff
9bdac157d2 SIL: Remove EnableTypedBoxes staging option.
Swift SVN r29762
2015-06-27 18:10:12 +00:00
Joe Groff
910badfe4d SIL: Stage in a typed-boxes dialect.
When -sil-enable-typed-boxes is passed, have alloc_box and dealloc_box instructions work with box types instead of NativeObject.

Swift SVN r29511
2015-06-19 16:39:04 +00:00
Doug Gregor
c8e3438f32 Add frontend option -disable-autolink-framework <framework>
This frontend option allows one to turn off autolinking to the
specified framework. This general capability is motivated by
rdar://problem/21246363, where we need to turn off some autolinking in
our overlays due to internal vs. public SDK differences.

Swift SVN r29393
2015-06-15 23:43:33 +00:00
Erik Eckstein
1aa561a1c8 Cleanup internal options in SIL pass manager.
I was always confused by the inconsistency of -sil-print-all and the other -sil-print options.
So I thought it would be a good idea to make -sil-print-all also an llvm option.
Together with some other internal options which are only used in the pass manager.



Swift SVN r29365
2015-06-12 13:37:00 +00:00
Slava Pestov
0c88c13c0d IRGen: Brazenly nuke -enable-dynamic-value-type-layout flag
The last remaining case was apparently @objc generic classes, which
seem to work now.

Also nuke the IRGen/unimplemented_objc_generic_class.swift test,
this is now implemented and we have other tests that test this
functionality.

Swift SVN r29260
2015-06-03 00:01:29 +00:00
Ted Kremenek
dad92b0084 Revert "IRGen: Brazenly nuke -enable-dynamic-value-type-layout flag"
Speculatively reverting because the iOS bots are broken.

Swift SVN r29145
2015-05-29 14:11:25 +00:00
Slava Pestov
9da369b5ba IRGen: Brazenly nuke -enable-dynamic-value-type-layout flag
The last remaining case was apparently @objc generic classes, which
seem to work now.

Also nuke the IRGen/unimplemented_objc_generic_class.swift test,
this is now implemented and we have other tests that test this
functionality.

Swift SVN r29138
2015-05-29 06:19:06 +00:00
Dave Abrahams
d65f696344 Kill off [_]RawOptionSetType
Now that we are using OptionSetType for option sets, all the support for
doing things the old way can die.

Note: the fix-it that used to apply to RawOptionSetType, it seemed to me,
should still apply to OptionSetType, so I switched it over instead of
removing it.

Swift SVN r29066
2015-05-27 15:55:54 +00:00
Slava Pestov
fd256e70e3 EmitGuaranteedSelf is always on now
NFC except for removal of flag

Swift SVN r28427
2015-05-11 18:21:37 +00:00
Joe Groff
92cb2d1d05 Staging option for NS_OPTIONS importer changes.
NFC yet.

Swift SVN r28204
2015-05-06 16:48:59 +00:00
Joe Groff
898f8c5c94 Add a staging option for interface type mangling.
NFC yet.

Swift SVN r28190
2015-05-06 01:29:10 +00:00
John McCall
5a153b60d6 Remove the affirmative -import-error-handling option.
We may want to add a -no-import-error-handling option for
project staging, but there's no need for the positive form.

Swift SVN r28049
2015-05-01 20:41:41 +00:00
Chris Willmore
c7a0963d60 Add --enable-throw-without-try option to suppress warning about missing 'try'.
To be used by the debugger so expression parsing doesn't require 'try'
everywhere. <rdar://problem/20356764>

Swift SVN r27949
2015-04-29 23:51:40 +00:00
Doug Gregor
2c909b4d36 Remove Objective-C selector splitting options.
We're not going this way.

Swift SVN r27717
2015-04-25 03:59:00 +00:00
Joe Groff
31388b0899 ClangImporter: Import (some) vector types.
When -enable-simd-import is active, if we encounter a vector type, try to load the SIMD Swift module, and if successful, map float, double, and int vectors to SIMD.{Float,Double,Int}N types if they exist.

Swift SVN r27367
2015-04-16 19:04:09 +00:00
Ben Langmuir
f778836934 Add initializers to postfix-expr code completions
Previously, the only way to get initializers was completing after the
name of the type:
    Foo#^complete_here^#
    Foo(#^or_here^#

And now it will also work in unadorned expressions:
    #^a_top_level_completion^#
    bar(a, #^walked_into_a_bar^#

Unfortunately, not all our clients handle this well yet, so it's
protected by a language option.
    -code-complete-inits-in-postfix-expr

Swift SVN r27275
2015-04-14 14:54:08 +00:00
Devin Coughlin
d08b98b1ca Sema: Turn on availability checking by default
Enable checking for uses of potentially unavailable APIs. There is
a frontend option to disable it: -disable-availability-checking.

This commit updates the SDK overlays with @availability() annotations for the
declarations where the overlay refers to potentially unavailable APIs. It also changes
several tests that refer to potentially unavailable APIs to use either #available()
or @availability annotations.

Swift SVN r27272
2015-04-14 06:44:01 +00:00
Argyrios Kyrtzidis
8b250d6d35 [driver] Remove the 'swift-fixit' symlink and introduce '-emit-fixits-path' frontend option that
writes compiler fixits as source edits.

Driver option '-fixit-code' adds '-emit-fixits-path' for all the frontend invocations.

Swift SVN r27208
2015-04-10 17:33:29 +00:00
John McCall
f2cb782451 Add the -import-error-handling option (and ignore it for now).
Swift SVN r27192
2015-04-10 00:32:50 +00:00
Argyrios Kyrtzidis
6ee8f9b9b7 [driver] Add option "-fixit-code" which delegates to 'swift-fixit'.
Swift SVN r27142
2015-04-08 22:20:34 +00:00
Argyrios Kyrtzidis
623b9827b4 [driver] Separate "delegate to the migrator with swift-update" and "get compiler fixits with swift-fixit" functionalities.
Swift SVN r27139
2015-04-08 22:02:23 +00:00
Mark Lacey
bd14e0cc4c Remove -sil-devirt-threshold frontend option.
This was used by "deep devirtualization", which is no longer around, so
it is currently ignored.

Swift SVN r27138
2015-04-08 21:53:47 +00:00
Chris Willmore
d3a977d824 <rdar://problem/20402026> Remove scope entry/exit log entries
Don't emit scope entry/exit logging code in instrumentation for
playgrounds if -playground-high-performance option is passed.

Swift SVN r27046
2015-04-06 22:09:20 +00:00
Doug Gregor
5a22ea2339 Remove vestiges of "-diagnose-generic-extensions".
We're not going to require the type parameters to be redeclared on
extensions of generic types, so take away the staging option and
diagnostic.

Swift SVN r26854
2015-04-02 04:54:38 +00:00
Jordan Rose
960a4f164a Add LangOptions::EnableTargetOSChecking, so that LLDB can ignore OS mismatches.
In particular, this is problematic when libraries are loaded dynamically, and
may have newer deployment targets than the main executable.

Swift SVN r26786
2015-04-01 01:12:29 +00:00
Jordan Rose
8a3fcf621e Add -disable-testable-attr-requires-testable-module.
...which allows "@testable import" to work with modules not compiled for
testing. This isn't generally safe, but should be fine for clients like
SourceKit which just need to have the API available and might not be able
to properly rebuild the original target for testing.

We may revisit this in the future.

Swift SVN r26629
2015-03-27 16:36:41 +00:00
Devin Coughlin
bdc7475d6b Sema: Add temporary flag to stage in availability checking in implicit functions
This flag enables checking of availability (deprecation, explicit unavailability,
and potential unavailability) in synthesized functions. The flag will go away once this
checking is fully staged in.

Swift SVN r26624
2015-03-27 06:48:50 +00:00
Jordan Rose
a0c64d7533 Teach getEffectiveAccess() to respect -enable-testing.
SIL seems to be doing the right thing here already, which is great!

Part of rdar://problem/17732115. We'll be able to really see this working
with the next change: allowing references to testable things when using
"@testable import".

Swift SVN r26473
2015-03-24 02:17:01 +00:00
Doug Gregor
af4aa6db65 Opt-in diagnostic for extensions of generic types without generic parameters.
This warning is temporarily going being a flag so that, once it is safe to place generic parameters on extensions of generic types, we can opt-in to update our code when it is convenient.

Swift SVN r26416
2015-03-22 12:35:27 +00:00
Jordan Rose
c6739b6b6c Add the -enable-testing flag, and serialize it.
This flag indicates that internal APIs within the module should be made
available to client code for testing purposes. Currently does nothing.

Not ready for developer consumption yet, ergo a hidden frontend-only flag.

Part of testability (rdar://problem/17732115)

Swift SVN r26292
2015-03-19 02:20:38 +00:00
Erik Eckstein
f3ff3db85f Driver: small corrections according to Jordan's feedback
Swift SVN r26267
2015-03-18 17:43:47 +00:00
Erik Eckstein
5537cf84ca Driver: Support -num-threads <n> option.
Together with -wmo it enables multi-threaded compilation.
I didn't want to reuse the -j option for this, because -num-threads (even if n == 1) does change the generated code.
For details see commit message of r25930.



Swift SVN r26258
2015-03-18 10:05:11 +00:00
Jordan Rose
c9eeed3e2d Remove staging option -enable-private-discriminators.
Private discriminators for everybody!

Swift SVN r25997
2015-03-11 23:07:44 +00:00
Luqman Aden
0c6464aec7 [driver] Add -emit-sibgen option.
Swift SVN r25936
2015-03-10 18:31:08 +00:00
Erik Eckstein
8531045449 Add --num-threads option.
This is in preparation for multi-threaded code generation.
Currently this option has no effect yet.



Swift SVN r25883
2015-03-09 15:41:38 +00:00
Joe Groff
b5b65b83e9 Remove the -enable-union-import staging flag.
Swift SVN r25809
2015-03-06 23:08:11 +00:00