Commit Graph

881 Commits

Author SHA1 Message Date
pschuh
4fd0671e54 Merge pull request #25870 from pschuh/cpp-1
Add -enable-cxx-interop flag and support for extern "C" {}
2019-07-09 11:37:31 -07:00
Sergej Jaskiewicz
0ac6f3a3ad [Driver] Automatic -color-diagnostics flag is added *before* -Xfrontend 2019-07-09 15:53:35 +03:00
Parker Schuh
fa69a73ee4 Add -enable-cxx-interop flag and support for extern "C" {} 2019-07-08 11:43:35 -07:00
Sergej Jaskiewicz
0ed3bb1e17 [Driver] Implement -no-color-diagnostics flag 2019-07-08 04:22:06 +03:00
Doug Gregor
d0c5b6a4e1 Drop the unused -enable-opaque-result-types command-line option 2019-07-05 11:34:10 -07:00
Saleem Abdulrasool
f3655ed5b4 Frontend: correct -sdk search paths for !Darwin
This adjusts the runtime library import paths to add the OS/architecture
subdirectory to the path.  This allows the use of `-sdk` with the
compiler to target Android and Windows as well (and Linux).  The SDK
image is identical to that generated by the current CMake setup without
the host tools.  Ideally, we would change the layout for the modules on
other targets to be identical to the Darwin layout which converts to
OS/<module>/architecture.<extension> rather than
OS/architecture/<module>.<extension>.
2019-07-03 08:39:16 -07:00
Mike Ash
9df513ae7c [Interpreter] Clean up the /usr/lib/swift fallback code.
- Check the target triple at runtime to decide whether to use the fallback.
- Change isInResourceDir to actually check the resource dir.
- Use ArrayRef<std::string> instead of std::vector<std::string>.
2019-07-01 13:08:04 -04:00
Mike Ash
3f774094b7 [Interpreter] Fall back to loading Swift dylibs from /usr/lib/swift on Apple platforms.
Continue to load the dylibs next to the compiler if they exist. If they don't, then use the OS's dylibs.

rdar://problem/47528005
2019-07-01 13:08:04 -04:00
David Ungar
33204e1519 Fixes 2019-06-27 16:17:13 -07:00
David Ungar
599c51fe92 Fix default 2019-06-27 15:37:31 -07:00
David Ungar
c3c1f3ecce Default to disabling ASTScopeLookup 2019-06-23 12:48:41 -07:00
David Ungar
3a3145c0f4 Alternate SelfDC computation, fixes, and cleanups.
ASTScopeLookup by default
Create empty fn bodies for IDE tests.
Include initializer source range for property wrappers.
Add -disable-astscope-lookup
2019-06-23 09:17:09 -07:00
Arnold Schwaighofer
85bfbe2dd3 Merge pull request #25473 from aschwaighofer/back_deploy_dynamic_replacement
stdlib: Add backward deployment versions for the dynamic-replacement runtime functions
2019-06-18 09:02:22 -07:00
Arnold Schwaighofer
5d329464d6 Use thread private key to avoid weak linkage
We use one bit of the third reserved swift private tls key.

Also move the functionality into a separate static archive that is
always linked dependent on deployment target.
2019-06-17 15:03:45 -07:00
Alexis Laferrière
36e5b5ae78 Merge pull request #25152 from xymus/explicit-intro-version
Add CLI option to warn when a public decl has no introduction version
2019-06-17 15:01:41 -07:00
Alexis Laferrière
c44cff7c97 Add a CLI option to warn when a public decl has no availability
Add the command line option -require-explicit-availability to detect public
or `@usableFromInline` declarations and warn if they don't declare
an introduction OS version. This option should catch forgotten `@available`
attributes in frameworks where all services are expected to be introduced
by an OS version.

The option -require-explicit-availability-target "macOS 10.14, iOS 12.0"
can be specified for the compiler to suggest fix-its with the missing
attributes `@available(macOS 10.14, iOS 12.0, *)`.

rdar://51001662
2019-06-17 10:32:58 -07:00
Harlan Haskins
047749a745 Merge pull request #25419 from harlanhaskins/property-reprs
[ModuleInterface] Qualify all types in module interfaces
2019-06-14 14:23:08 -07:00
David Ungar
06527db4ab Merge pull request #24594 from davidungar/A5-7-ASTOOScope-rebased
[NameLookup] ASTOOScope ontology
2019-06-14 08:03:09 -07:00
Harlan Haskins
57f517317d Rename flag to ‘module-interface-preserve-types-as-written’ 2019-06-13 11:26:54 -07:00
Harlan Haskins
889e43076f [ModuleInterface] Allow falling back to prefer TypeReprs
There are still cases (a module with a type that's the same name as the
module) where we cannot fully qualify all types. In those cases, allow
them to remain unqualified with a flag, `-Xfrontend
-preserve-types-as-written-in-module-interface`.
2019-06-13 11:26:54 -07:00
David Ungar
6cfcabd8e5 add -disable-parser-lookup 2019-06-11 09:08:10 -07:00
Mishal Shah
c2848e793f Merge pull request #25236 from apple/update-master-xcode-11-beta1
Update master to build with Xcode 11 beta, macOS 10.15, iOS 13, tvOS 13, and watchOS 6 SDKs
2019-06-06 11:22:40 -07:00
mishal_shah
1e38fc3030 Update master to build with Xcode 11 beta, macOS 10.15, iOS 13, tvOS 13, and watchOS 6 SDKs 2019-06-03 22:50:02 -07:00
Joe Groff
4ed8de10f9 Revert "Revert "Use autolinking to pull in compatibility libraries."" 2019-06-03 20:10:51 -07:00
Joe Groff
a7cc3a38cc Revert "Use autolinking to pull in compatibility libraries." 2019-06-03 14:18:39 -07:00
Raj Barik
d40207743c Merge pull request #25038 from atrick/fix-specializer-leak
Fix ExistentialSpecializer to correctly cleanup storage.
2019-06-03 09:31:47 -07:00
Joe Groff
dffd1b27a1 Use autolinking to pull in compatibility libraries.
Many build systems that support Swift don't use swiftc to drive the linker. To make things
easier for these build systems, also use autolinking to pull in the needed compatibility
libraries. This is less ideal than letting the driver add it at link time, since individual
compile jobs don't know whether they're building an executable or not. Introduce a
`-disable-autolink-runtime-compatibility` flag, which build systems that do drive the linker
with swiftc can pass to avoid autolinking.

rdar://problem/50057445
2019-05-31 13:11:14 -07:00
Arnold Schwaighofer
7e646847c7 SILGen: Add an option to disable the previous implementation inside of dynamic replacement thunks
@_dynamicReplacement(for: selfRec(x: acc:))
  func selfRec_r(x: Int, acc: Int) -> Int {
    if x <= 0 {
      return acc
    }
    // Normally, this will call selfRec(x: acc:)'s implementation.
    // With the option, this will call to selfRec_r(x: acc:).
    return selfRec(x: x - 1, acc: acc + 1)
  }

rdar://51229650
2019-05-29 11:31:27 -07:00
David Ungar
663760e3b7 ASTOOScope ontology 2019-05-28 10:48:22 -07:00
Andrew Trick
2ce1473b74 [NFC] Remove remnants of the old -sil-existential-specializer option.
This option no longer works but was still in the option file and help
message.

Add a temporary pass-specific option instead for debugging until this
pass has been sufficiently tested yet.
2019-05-23 17:20:34 -07:00
Jordan Rose
517f5d6b6a [ClangImporter] Retire the term "adapter" in favor of "overlay" (#24427)
Way back in Swift 1 I was trying to draw a distinction between
"overlays", separate libraries that added Swift content to an existing
Objective-C framework, and "the Swift part of a mixed-source
framework", even though they're implemented in almost exactly the same
way. "Adapter module" was the term that covered both of those. In
practice, however, no one knew what "adapter" meant. Bring an end to
this confusion by just using "overlay" within the compiler even for
the mixed-source framework case.

No intended functionality change.
2019-05-03 11:11:58 -07:00
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