Commit Graph

1791 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis
1d5e9e0acd [FixCode] Introduce '-fixit-all' option that, when -fixit-code is enabled, applies all fixits from diagnostics without any filtering.
Swift SVN r31772
2015-09-08 18:30:49 +00:00
Jordan Rose
6e8140b871 Handle debug-crash options in separate functions.
...so they show up in stack traces.

Swift SVN r31592
2015-09-01 00:22:29 +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
d609aa461d Always serialize absolute search paths.
...and always serialize -working-directory for Clang. (But allow it to be
overridden by a later -Xcc -working-directory.)

Not having this has caused plenty of headaches for the debugger, which is the
primary client of this information. We can still get into bad situations with
search paths that don't exist at all (say, when a built framework is transferred
to another computer), but at least we won't fall over in multi-project workspaces.

This isn't an actual command-line option for a few reasons:

- SourceKit is still using frontend options directly, and they'll need something
  like this to fix rdar://problem/21912068.
- We might want to be more formal about passing this to Clang.
- I don't actually like the existence of such an option for users.

We can revisit this later if the scales tip. Fixing the debugging issue is the
priority.

rdar://problem/21857902

Swift SVN r30500
2015-07-22 20:20:33 +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
Jordan Rose
0e3e08f0c6 [ClangImporter] Use Clang's -fembed-bitcode mode when under -embed-bitcode.
This should have no functionality change, but is supposed to keep us from
accidentally relying on the "full" Clang importer when in a backend job.
I tested it by archiving a little iOS app from a developer.

Unfortunately, part of the motivation here was that we'd get error messages when
we pass something Clang doesn't like, and that doesn't seem to be happening.

rdar://problem/21389553

Swift SVN r30407
2015-07-20 17:23:51 +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
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
Dmitri Hrybenko
502d0d5120 Adjust to the new ParseArgs API
Swift SVN r29701
2015-06-25 22:01:40 +00:00
Roman Levenstein
251bda4959 Add a field to SILOption to represent the current optimization level.
The value is set based on the -O command-line option. It is generally useful if SIL optimization passes can check the current optimization level.
A couple of subsequent commits are going to make use of this information.

Swift SVN r29653
2015-06-25 02:38:02 +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
Jordan Rose
c516ef9223 [IRGen] Remove unnecessary IRGenOptions flag HasUnderlyingModule.
The test that it's guarding is cheap enough to do all the time, and we
don't have any interesting configurations where it's not set any more.

Swift SVN r29442
2015-06-17 04:48:09 +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
David Farler
5dbc33f8ac Don't crash the frontend if a bad target is given
Provide a chance to emit a diagnostic instead.

rdar://problem/20931800

Swift SVN r28940
2015-05-23 00:58:05 +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
John McCall
ac50cbc801 Enable error-handling in import by default.
Swift SVN r28048
2015-05-01 20:35:28 +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
Luqman Aden
ce4bff5645 Frontend: Allow passing .sil as -primary-file along with other .sib as input.
Swift SVN r27612
2015-04-22 22:53:18 +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
Connor Wakamo
eb36def696 [frontend] Updated the behavior for -import-module so it can be specified multiple times.
Instead of only honoring the last occurrence of -import-module, the frontend now
honors all occurrences of -import-module, making all of the modules specified on
the command line implicitly visible.

This fixes <rdar://problem/20422696>.

Swift SVN r27299
2015-04-15 00:22:48 +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
Devin Coughlin
53fd9fb59c Sema: Finish staging back in availability checking in synthesized functions
Remove the suppression of deprecation and potential unavailability diagnostics in
synthesized functions. We still suppress some explicit unavailability diagnostics -- those
in synthesized functions in synthesized functions that are lexically contained in
declarations that are themselves annotated as unavailable. For these cases, the right
solution <rdar://problem/20491640> is to not synthesize the bodies of these functions in
the first place.

rdar://problem/20024980

Swift SVN r27203
2015-04-10 05:19:04 +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
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
David Farler
654f74c4f4 Build armv7s for iOS, use architecture names in paths
Up to now we've been assuming that we have only one 32-bit target and
one 64-bit target per platform. There is a need to be able to build
armv7s for iOS, but assumptions abound in the organization of files per
architecture - tests, cmake targets, and installation.

- Build armv7s when building for iOS
- Use the actual architecture name, not blank or "/32" in all paths
  related to architecture.

Testing: Clean buildbot incremental RA tests pass (requires a test
update in SourceKit as well).

rdar://problem/20206215

Swift SVN r26600
2015-03-26 20:25:32 +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
Jordan Rose
367bfbc374 Require "import Foundation" to use @objc in library files, too.
Make this diagnostic a little nicer in other ways, too:
- Highlight the whole attribute (including the at-sign).
- Don't hardcode the string "objc".

Swift SVN r25999
2015-03-11 23:07:48 +00:00