Commit Graph

800 Commits

Author SHA1 Message Date
Harlan Haskins
81a68f28ef [Frontend] Default the prebuilt cache to <resourcedir>/<platform>/prebuilt-modules (#24295)
By default, prebuilt modules will live in
<resource-dir>/<platform>/prebuilt-modules, so make this explicit if it wasn't
passed in explicitly.
2019-04-26 13:52:41 -07:00
Slava Pestov
3f5a06bc3e AST: Always diagnose request evaluator cycles 2019-04-22 22:22:23 -04:00
Brent Royal-Gordon
814d50c7e6 Merge pull request #24163 from brentdax/line-line-line-line
Add -debug-constraints-on-line flag
2019-04-22 16:54:00 -07:00
Brent Royal-Gordon
3dca63efea Remove early returns in ParseLangArgs
Several places in language option parsing return early after diagnosing an error when they could instead continue parsing and discover addtional errors to diagnose. Change these to set an error flag instead.

OPT_package_description_version still has an early return on the theory that, if you’re using a too-old compiler to parse a Package.swift file, you’re probably confused about the Swift compiler version you’re using and further errors may be for arguments that would be accepted by a newer compiler.
2019-04-22 14:00:47 -07:00
Brent Royal-Gordon
79cee8daad Add -debug-constraints-on-line flag 2019-04-22 13:59:50 -07:00
Joe Groff
5e1497967a Parse opaque types. 2019-04-17 14:43:32 -07:00
Michael Gottesman
83bce036bb [sil] Fix thinko in a frontend option. 2019-04-14 01:58:19 -07:00
Michael Gottesman
6319820b73 Merge pull request #24021 from gottesmm/pr-b7b7d99bb250853de9886919f2a787ef5990b6b2
[ownership] Add a frontend option to strip ownership after serializat…
2019-04-14 01:04:58 -07:00
Michael Gottesman
1defc94966 [ownership] Add a frontend option to strip ownership after serialization.
I am going to use this to ensure some end-to-end tests that do not inline from
the stdlib will work after flipping the switch and stripping ownership after
serialization.
2019-04-13 20:53:42 -07:00
eeckstein
395750fbaa Merge pull request #23999 from eeckstein/fix-gsil
DebugInfo: fix debugging on SIL level
2019-04-13 18:48:49 -07:00
Erik Eckstein
b8c226cb08 DebugInfo: fix debugging on SIL level
The fix is to set the DebugCompilationDir when -gsil is used.
Otherwise no debug info is generated if the source file name does not contain a path.

rdar://problem/49796695
2019-04-12 16:12:17 -07:00
Harlan Haskins
e5456984f7 [ModuleInterfaces] Remove 'parseable' from command-line flags
Leave the old flag in as an alias to the new flag, for transition
purposes. Also go ahead and remove the long-deprecated and unused
`emit-interface-path`.

Part of rdar://49359734
2019-04-11 18:05:09 -07:00
Adrian Prantl
4a23512068 Add an option to disable DWARF skeleton CU breadcrumbs for Clang
module imports. This is useful when building redistributable static
archives, since any pointers into the CLang module cache won't be
portable.

When using this option the Clang type fallback path in LLDB will be
less useful since DWARF type information from those modules will not
be available unless another object file compiled without the option
imported the same modules.

rdar://problem/48827784
2019-04-03 15:45:11 -07:00
Adrian Prantl
b8de883ca3 Remove the -resilience-bypass flag and functionality.
LLDB no longer depends on it.

rdar://problem/48018240
2019-03-29 13:56:17 -07:00
Michael Gottesman
f699e0e8d0 [ownership] Remove the -enable-mandatory-semantic-arc-opts flag now that it is enabled by default. 2019-03-27 18:33:21 -07:00
adrian-prantl
e622ea6980 Merge pull request #23465 from adrian-prantl/48018240-irgen
Add a -public-linkage-for-metadata-accessors IRGen flag for LLDB.
2019-03-27 12:13:41 -07:00
Adrian Prantl
e1f92cc39e Add a -force-public-linkage IRGen flag for LLDB.
In LLDB expressions, references to private metadata accessors may be
emitted and need to be bound to symbols available in the attached
program, even if these symbols are only supposed to have private
visibility within the program.

Also rdar://problem/48018240
2019-03-27 09:10:23 -07:00
Slava Pestov
583c0d9ebe Frontend: Add -enable-resilient-objc-class-stubs command line flag 2019-03-26 18:43:00 -04:00
Michael Gottesman
f854547c55 [ownership] Enable ownership verification by default.
I also removed the -verify-sil-ownership flag in favor of a disable flag
-disable-sil-ownership-verifier. I used this on only two tests that still need
work to get them to pass with ownership, but whose problems are well understood,
small corner cases. I am going to fix them in follow on commits. I detail them
below:

1. SILOptimizer/definite_init_inout_super_init.swift. This is a test case where
DI is supposed to error. The only problem is that we crash before we error since
the code emitting by SILGen to trigger this error does not pass ownership
invariants. I have spoken with JoeG about this and he suggested that I fix this
earlier in the compiler. Since we do not run the ownership verifier without
asserts enabled, this should not affect compiler users. Given that it has
triggered DI errors previously I think it is safe to disable ownership here.

2. PrintAsObjC/extensions.swift. In this case, the signature generated by type
lowering for one of the thunks here uses an unsafe +0 return value instead of
doing an autorelease return. The ownership checker rightly flags this leak. This
is going to require either an AST level change or a change to TypeLowering. I
think it is safe to turn this off since it is such a corner case that it was
found by a test that has nothing to do with it.

rdar://43398898
2019-03-25 00:11:52 -07:00
Michael Gottesman
0dfaa19f9f [ownership] Rename enable-sil-ownership => verify-sil-ownership.
I have been meaning to do this change for a minute, but kept on putting it off.
This describes what is actually happening and is a better name for the option.
2019-03-18 01:31:44 -07:00
swift-ci
497e94e89d Merge pull request #23235 from mikeash/remove-stable-abi-bit-configuration 2019-03-15 15:31:58 -07:00
Slava Pestov
9626340d4b Sema: Remove unused -fix-string-to-substring-conversion flag 2019-03-14 22:08:43 -04:00
Mike Ash
597dcd8f3f [Stdlib][Frontend][CMake] Remove SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT option, make it permanently on. 2019-03-13 09:31:50 -04:00
Brent Royal-Gordon
21b96d4840 Merge pull request #23175 from brentdax/theres-a-path-for-everyone
Look for runtime library modules in the SDK, too
2019-03-12 22:27:01 -07:00
Brent Royal-Gordon
c177674855 Load runtime library modules from SDK
With this change, swiftc will still look for standard library and overlay modules in ../lib/swift (relative to the compiler), but if it doesn’t find them there, it will now look in usr/lib/swift in the SDK.
2019-03-12 19:45:27 -07:00
Brent Royal-Gordon
46ddb2a607 [NFC] Support many runtime library import paths
Replaces SearchPathOptions::RuntimeLibraryImportPath with an equivalent std::vector of paths. Also reimplements SearchPathOptions::SkipRuntimeLibraryImportPaths to cause the list of runtime library import paths to be empty, rather than exiting early from SerializedModuleLoader::findModule().
2019-03-11 19:06:51 -07:00
Saleem Abdulrasool
8357457764 IRGen: avoid constant conformances on Windows
Windows does not permit cross-module data accesses to be direct.  This
is a problem for public protocols with root conformances which are
external.  Use a runtime initialiser for the root protocol conformance
chaining to alleviate this issue.  This shows up in the Foundation
build.
2019-03-11 14:12:55 -07:00
Mike Ash
082b3774ad [Frontend] Emit the pre-stable-ABI bit when targeting older OS versions. 2019-03-07 10:12:27 -05:00
Jordan Rose
43feb9cbe1 On Apple platforms, use swiftmodule directories for the stdlib (#21797)
This changes the Swift resource directory from looking like

    lib/
      swift/
        macosx/
          libswiftCore.dylib
          libswiftDarwin.dylib
          x86_64/
            Swift.swiftmodule
            Swift.swiftdoc
            Darwin.swiftmodule
            Darwin.swiftdoc

to

    lib/
      swift/
        macosx/
          libswiftCore.dylib
          libswiftDarwin.dylib
          Swift.swiftmodule/
            x86_64.swiftmodule
            x86_64.swiftdoc
          Darwin.swiftmodule/
            x86_64.swiftmodule
            x86_64.swiftdoc

matching the layout we use for multi-architecture swiftmodules
everywhere else (particularly frameworks).

There's no change in this commit to how Linux swiftmodules are
packaged. There's been past interest in going the /opposite/ direction
for Linux, since there's not standard support for fat
(multi-architecture) .so libraries. Moving the .so search path /down/
to an architecture-specific directory on Linux would allow the same
resource directory to be used for both host-compiling and
cross-compiling.

rdar://problem/43545560
2019-02-19 14:47:21 -08:00
Slava Pestov
b64db715a8 IRGen: Remove -enable-class-resilience staging flag 2019-02-08 14:22:00 -05:00
Slava Pestov
5680bfde55 IRGen: Always use YAML files for completely fragile class layout
The layouts of resilient value types shipped in the Swift 5 standard library
x and overlays will forever be frozen in time for backward deployment to old
Objective-C runtimes. This PR ensures that even if the layouts of these types
evolve in the future, binaries built to run on the old runtime will continue
to lay out class instances in a manner compatible with Swift 5.

Fixes <rdar://problem/45646886>.
2019-02-08 14:22:00 -05:00
Slava Pestov
bb4cae06d0 IRGen: Rename -read-type-info-path flag to -read-legacy-type-info-path 2019-02-08 14:22:00 -05:00
Saleem Abdulrasool
6fa9000790 Frontend: compare normalised absolute paths for temp
The LLVM API for the temporary paths behaves differently on Windows and Unix.
Windows always returns the absolute path, and on Unix, you get whatever is in
the environment.  Furthermore, windows allows both `\` and `/` as separators.
Normalise the path and make it absolute before doing the comparision to get a
comparable string.
2019-02-05 17:38:46 -08:00
David Ungar
520b801bf0 Merge pull request #21177 from davidungar/A-exp-dep-graph-12-10-18
First cut at graph-based fine-grained experimental dependencies.
2019-02-03 21:15:17 -08:00
David Ungar
2f65ac3735 Cosmetic cleanups 2019-01-30 17:16:49 -08:00
David Ungar
b520b242dc Collapsed lots of changes. 2019-01-24 18:46:49 -08:00
Doug Gregor
0c88b88322 [ABI] Optionally emit mangled names into anonymous context metadata.
When -enable-anonymous-context-mangled-names is provided, emit mangled
names as part of the metadata of an anonymous context. This will allow
us to match textual mangled names to the metadata.

This is a backward-compatible ABI extension. Part of rdar://problem/38231646/.
2019-01-22 09:48:47 -08:00
Ankit Aggarwal
45290837b4 Merge pull request #21110 from aciidb0mb3r/swiftpm-manifest-version
Extend @available to support PackageDescription
2019-01-07 12:20:23 -08:00
Michael Gottesman
9dc8bbb866 [ownership] Eliminate -assume-parsing-unqualified-ownership-sil now that it is a no-op. 2018-12-19 12:54:13 -08:00
Xi Ge
4164600bed migrator: set up placeholder migration scripts for swift 4.2 2018-12-18 11:49:14 -08:00
Jordan Rose
00ed3e1185 [Driver] Don't suggest using the "major version" for -swift-version (#20563)
This was a nice feature when people said "-swift-version 3.1"...
up until we got "-swift-version 4.2" as an actual valid version.
Just drop the special case.

https://bugs.swift.org/browse/SR-8850
2018-12-10 08:41:21 -08:00
Ankit Aggarwal
92d09f4e19 Extend @available to support PackageDescription
<rdar://problem/46548531> Extend @available to support PackageDescription

This introduces a new private availability kind "_PackageDescription" to
allow availability testing by an arbitary version that can be passed
using a new command-line flag "-swiftpm-manifest-version". The semantics
are exactly same as Swift version specific availability. In longer term,
it maybe possible to remove this enhancement once there is
a language-level availability support for 3rd party libraries.

Motivation:

Swift packages are configured using a Package.swift manifest file. The
manifest file uses a library called PackageDescription, which contains
various settings that can be configured for a package. The new additions
in the PackageDescription APIs are gated behind a "tools version" that
every manifest must declare. This means, packages don't automatically
get access to the new APIs. They need to update their declared tools
version in order to use the new API. This is basically similar to the
minimum deployment target version we have for our OSes.

This gating is important for allowing packages to maintain backwards
compatibility. SwiftPM currently checks for API usages at runtime in
order to implement this gating. This works reasonably well but can lead
to a poor experience with features like code-completion and module
interface generation in IDEs and editors (that use sourcekit-lsp) as
SwiftPM has no control over these features.
2018-12-08 09:38:40 +05:30
Slava Pestov
aa747dcd81 Remove property behaviors 2018-12-07 20:38:33 -05:00
Harlan Haskins
2e50a431b1 Merge pull request #20986 from harlanhaskins/clogged-pipes
[SILOptimizer] Stop optimization after serialization if only emitting a module
2018-12-06 15:49:11 -08:00
Harlan Haskins
b137928ff5 [SILOptimizer] Add flag to stop optimization after serialization 2018-12-04 16:44:01 -08:00
Adrian Prantl
ff63eaea6f Remove \brief commands from doxygen comments.
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.

Patch produced by

      for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
2018-12-04 15:45:04 -08:00
Slava Pestov
b570a5de87 Remove -enable-key-path-resilience staging flag 2018-11-16 23:18:37 -05:00
Saleem Abdulrasool
da724b34ed Merge pull request #20574 from compnerd/lazy-metadata
IRGen: force lazy metadata initialization for PE/COFF
2018-11-15 16:22:18 -08:00
Saleem Abdulrasool
13d56a4f56 IRGen: force lazy metadata initialization for PE/COFF
The metadata reference to the pre-exsting VWT cannot be supported on PE/COFF
due to the direct reference to a value in an external module that is in
static data (the model requires indirecting through memory).  Always
force the lazy initialization for the metadata on such platforms.

This requires a secondary change - to initialize the VWT as well.  This
is ideally moved into the runtime where we can do this uniformly.
2018-11-15 11:05:47 -08:00
Arnold Schwaighofer
c3230dfc5c Add the implicit dynamic attribute in the IsDynamicRequest query 2018-11-14 12:04:17 -08:00