Commit Graph

1813 Commits

Author SHA1 Message Date
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
Jordan Rose
c9eeed3e2d Remove staging option -enable-private-discriminators.
Private discriminators for everybody!

Swift SVN r25997
2015-03-11 23:07:44 +00:00
Manman Ren
6071ac39d2 [bitcode project] do not encode primary file in CmdArgs.
Swift SVN r25945
2015-03-10 19:58:27 +00:00
Luqman Aden
0c6464aec7 [driver] Add -emit-sibgen option.
Swift SVN r25936
2015-03-10 18:31:08 +00:00
Argyrios Kyrtzidis
3e1390fe70 [LangOptions] Enable dollar identifiers under a separate language option.
I intend to use such identifiers for placeholder replacements.

Swift SVN r25896
2015-03-09 23:02:55 +00:00
Erik Eckstein
460eea3b95 Let the frontend options handle multiple output files.
This will be needed for split-llvm code generation.
If multiple -o options are specified and only a single output file is needed
(currently always), the last one wins. This is NFC.



Swift SVN r25884
2015-03-09 16:24:52 +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
Michael Gottesman
494305dcd1 Revert "Remove sil option flags that are no longer needed."
This reverts commit r25828. I forgot that some tests depend on these. Thanks
Andy!

Michael

Swift SVN r25832
2015-03-07 03:10:15 +00:00
Michael Gottesman
e40f01c9ed Remove sil option flags that are no longer needed.
Swift SVN r25828
2015-03-07 02:31:52 +00:00
Joe Groff
b5b65b83e9 Remove the -enable-union-import staging flag.
Swift SVN r25809
2015-03-06 23:08:11 +00:00
Arnold Schwaighofer
8482dbbb93 IRGen: Remove different NoAlias behavior at Ounchecked
As per discussion on the mailing list we don't want different behavior for
programmer errors at Ounchecked than at O for errors that are not diagnosable.

Neither O nor Ounchecked will now emit LLVM's NoAlias attribute for inout
parameters.

rdar://20041458

Swift SVN r25784
2015-03-05 19:17:23 +00:00
Luqman Aden
34b74cfa1c [driver] Add -emit-sib primary action.
Swift SVN r25783
2015-03-05 19:15:07 +00:00
Arnold Schwaighofer
edf4461ba3 IRGen: Marking inout parameter NoAlias at the LLVM level is not memory safe
We have to guarantee memory safety in the presence of the user violating the
inout assumption.  Claiming NoAlias for parameters that might alias is not
memory safe because LLVM will optimize based on that assumption.

Unfortunately, this means that llvm can't optimize arrays as aggressively. For
example, the load of array->buffer won't get hoisted out of loops (this is the
Sim2DArray regression below).

-O numbers (before/after):

CaptureProp 0.888365
Chars 1.09143
ImageProc 0.917197
InsertionSort 0.895204
JSONHelperDeserialize 0.909717
NSDictionaryCastToSwift 0.923466
Sim2DArray 0.76296
SwiftStructuresBubbleSort 0.897483

Continue emitting noalias for inout when compiling Ounchecked.

rdar://20041458

Swift SVN r25770
2015-03-04 22:43:14 +00:00
Manman Ren
962febb3be [Driver] use enum instead of two flags for embedding bitcode options.
No functionality change.
 
rdar://19048891


Swift SVN r25581
2015-02-27 01:03:16 +00:00
Manman Ren
9d680564db [Driver] fix support for -embed-bitcode-marker.
Move helper function EmbedBitcode() from frontend_main.cpp to IRGen.cpp so we
can call it from performIRGeneration when the input file is Swift.

Add testing case to make sure that -embed-bitcode-marker option adds an
empty LLVM bitcode section.

rdar://19048891


Swift SVN r25577
2015-02-27 00:37:35 +00:00
Manman Ren
48fa3d2e21 [Driver] actually embed bitcode and command line arguments for -embed-bitcode.
With -embed-bitcode, save a copy of the llvm IR as data in the __LLVM,__bitcode
section and save the command-line options in the __LLVM,__cmdline section.

rdar://19048891


Swift SVN r25560
2015-02-26 20:29:46 +00:00
Manman Ren
d39f8e49a8 [Driver] make Swift accept bitcode input.
Thanks Jordan for reviewing the patches.
rdar://19048891


Swift SVN r25558
2015-02-26 19:31:09 +00:00
Manman Ren
a43db3621f [Driver] add InputFileKind to FrontendOptions.
Separate InputFileKind from SourceFileKind, FrontendOptions will now use
InputFileKind, while Module will use SourceFileKind.

This is in preparation for adding an input file kind for LLVM IR.

rdar://19048891


Swift SVN r25555
2015-02-26 19:13:39 +00:00
Michael Gottesman
a598b46fc1 Add support for -Oplayground and add some sanity tests for it.
Right now this is just like -Onone. We will add further optimizations as
needed.

<rdar://problem/19328293>

Swift SVN r25377
2015-02-18 22:30:26 +00:00
Joe Groff
94be8424ff Sema: Type checking for C function pointers.
Since a function pointer doesn't carry any context, we can only form a C function pointer from a static reference to a global function or a context-free local function or closure. (Or maybe a static function applied to its metatype, but that's not handled here yet.) As a placeholder for a to-be-bikeshedded surface syntax, let the existing @cc(cdecl) attribute appear in source text when the -enable-c-function-pointers frontend flag is passed.

Swift SVN r25308
2015-02-16 00:41:53 +00:00
Justin Bogner
d44090d29e InstrProf: Optionally generate coverage maps when profiling
This adds the -profile-coverage-mapping option to swift, and teaches
SILGenProfiling to generate mappings from source ranges to counters.

Swift SVN r25266
2015-02-13 08:42:15 +00:00
Jordan Rose
6e96e26a81 Add CompilerInvocation::loadFromSerializedAST.
This is mainly for the debugger's use, to set up CompilerInvocations that
match how a particular app was compiled in certain important ways. Today
that's the target (which is also in the binary), the SDK path (which in
the long run should probably be an SDK name), and any random -Xcc options
we need to pass (which we should probably attempt to minimize).

Because there's only one target and SDK per context, and because -Xcc
options can easily conflict, this is only intended to be used once per
CompilerInvocation.

Note that search paths are not covered by this; they are already being
added at the time the module is loaded. See r24545.

Completes rdar://problem/17670778.

Swift SVN r25227
2015-02-12 05:32:37 +00:00
Justin Bogner
a49008298e InstrProf: Set up the basic infrastructure for profiling swift
This adds the -profile-generate flag, which enables LLVM's
instrumentation based profiling. It implements the instrumentation
for basic control flow, such as if statements, loops, and closures.

Swift SVN r25155
2015-02-11 01:06:18 +00:00
Joe Groff
a4c777320e IRGen: Change type layout verifier to take a type by name to verify.
Swift SVN r25088
2015-02-09 02:51:41 +00:00
Joe Groff
8e1e6665a7 IRGen: Start a type verifier to fuzz static type info against runtime type info.
We've had a rash of bugs due to inconsistencies between how IRGen and the runtime think types are laid out. Add a '-verify-type-layout' mode to the frontend that causes IRGen to emit a bunch of code that compares its static assumptions against what the runtime value witness does.

Swift SVN r24918
2015-02-03 16:47:25 +00:00
Jordan Rose
c97c949fcf Add frontend flag -import-module <name>.
This implicitly adds the named module as an import of every source file
in the module being compiled. This is not intended to be used generally,
but will be useful for playgrounds.

rdar://problem/19605934

Swift SVN r24905
2015-02-02 22:20:13 +00:00
Joe Groff
9489605a8f Enable vtable thunks.
Swift SVN r24736
2015-01-26 21:52:20 +00:00
Joe Groff
a449948275 SILGen: Emit vtable thunks to handle optional variance.
If a subclass overrides methods with variance in the optionality of non-class-type members, emit a thunk to handle wrapping more optional parameters or results and force-unwrapping any IUO parameters made non-optional in the derived. For this to be useful, we need IRGen to finally pay attention to SILVTables, but this is a step on the way to fixing rdar://problem/19321484.

Swift SVN r24705
2015-01-24 05:21:26 +00:00
Graham Batty
83dd7bf854 frontend: set a sensible default objc-interop.
Swift SVN r24642
2015-01-22 18:20:23 +00:00