Commit Graph

107 Commits

Author SHA1 Message Date
Xi Ge
bae31467a3 Merge pull request #30962 from nkcsgexi/44777994
AST: making `export: true` in @_specialized attribute a no-operation
2020-04-10 18:39:22 -07:00
Xi Ge
435d13496e AST: making export: true in @_specialized attribute a no-operation
The client code doesn't actually call into these specialized functions even
though they have public linkage. This could lead to TBD verification failure
shown in rdar://44777994.

This patch also warns users' codebase when `export: true` is specified.
2020-04-10 16:52:22 -07:00
Doug Gregor
b6df6ef59f Merge pull request #30843 from DougGregor/consistent-simulator-triples
[Build] Use simulator triples consistently
2020-04-07 20:23:51 -07:00
Doug Gregor
7a2c28db1a [TBD] Update test to account for iOS device vs. iOS simulator.
The test was only checking iOS, and assuming that simulator targets
would behave the same way. Make the test amenable to both iOS and
iOS simulator.
2020-04-06 16:52:56 -07:00
Cyndy Ishida
6a29923c5e [TBDGen] update tbd version
Short overview of new TBD-v4 format changes:

* special section for reexported symbols (which is not seen any
differently to the linker)

* target based slices as opposed to just architecture

more information in: rdar://problem/60586390
2020-04-03 20:38:15 -07:00
Xi Ge
31afb3f692 Revert "TBDGen: avoid emitting symbols with OBJC_CLASS and OBJC_METACLASS prefixes"
For clang decls marked with SWIFT_CLASS, these explicit class initializer symbols turn
out to be necessary in the TBD files.

rdar://60857470
2020-03-26 10:46:53 -07:00
Xi Ge
251edf3765 TBDGen: don't emit $ld$previous$ symbols for added members to a moved decl
When a top-level decl is marked with @_originallyDefinedIn, some of its members
may also be newly added after the top-level decl has been moved to the current module.
For these members, we don't need emit $ld$previous$ symbols for them.

rdar://60478650
2020-03-15 19:02:31 -07:00
Xi Ge
1fc0799e8b TBDGen: omit witness table symbol for imported resilient protocols
For imported resilient protocols, we cannot directly emit witness table
symbol when a local type conforms to them because initializing these
protocols are required.

rdar://60429448
2020-03-13 13:46:50 -07:00
Kuba (Brecka) Mracek
b2edf20a81 Merge pull request #30112 from apple/mracek/arm64e
Add arm64e and pointer authentication support for Swift
2020-03-07 20:38:36 -08:00
Xi Ge
699e05712f TBDGen: avoid emitting symbols with OBJC_CLASS and OBJC_METACLASS prefixes
rdar://60057489
2020-03-06 16:07:57 -08:00
Kuba (Brecka) Mracek
ab6533a40f Merge branch 'master' into mracek/arm64e 2020-03-06 15:07:01 -08:00
Xi Ge
2f5f66b9da Re-apply "TBDGen: pass-down target variant when generating textual interface stubs"
rdar://60057760
2020-03-05 11:00:14 -08:00
Rintaro Ishizaki
58d4868e42 Revert "TBDGen: pass-down target variant when generating textual interface stubs" 2020-03-04 22:01:24 -08:00
Xi Ge
6dde0e6abc TBDGen: pass-down target variant when generating textual interface stubs
rdar://60057760
2020-03-04 15:52:29 -08:00
Kuba Mracek
1bd425da67 [arm64e] Test changes to support arm64e 2020-02-27 16:10:48 -08:00
Mishal Shah
02823682ac Fix the REQUIRES to executable_test from executable_only 2020-02-26 02:32:46 +05:30
Mishal Shah
94db94741d [Test] Mark the tests to run on executable_only to avoid failure (59774397) 2020-02-26 02:24:38 +05:30
Xi Ge
e013f1fb81 TBDGen: add a flag for embedding external symbols in emitted tbd file
Static-linked libraries could add symbols to the final tbd file. We need
this flag to specify additional module names to collect symbols from.

rdar://59399684
2020-02-12 13:47:59 -08:00
Xi Ge
26c16174f8 TBDGen: also using target variant to decide whether @_originallyDefinedIn is active
This ensures we could emit linker directives for multiple platforms when building
zippered libraries.
2020-01-27 15:29:01 -08:00
Xi Ge
3ee9b1175c TBDGen: when previous install name map is specified, emit $ld$previous linker directives.
Progress towards: rdar://58281536
2020-01-17 15:57:25 -08:00
Xi Ge
caf88fb1eb TBDGen: some refactoring to allow multiple platform kinds for linker directives.
Tentatively fixing: rdar://58569201
2020-01-16 11:42:03 -08:00
Arnold Schwaighofer
49d89faad6 Disable test that fails on the ASAN bot
rdar://58569201
2020-01-15 07:00:01 -08:00
Xi Ge
90f59e4336 TBDGen: teach the compiler to take a json file indicating previous install names
Using the new linker directives $ld$previous requires the compiler to know the previous
install names for the symbols marked as removed. This patch teaches the compiler
to take a path to a Json file specifying the map between module names and previous
install names. Also, these install names can be platform-specific.

Progress towards: rdar://58281536
2020-01-13 17:45:40 -08:00
Xi Ge
d0b4da6fc6 test: mark linker directives tests as macosx only 2019-12-13 21:56:27 -08:00
Xi Ge
3a55c3c96e Front-end: teach the compiler to generate a .c file for $ld$add$os symbols.
When symbols are moved to this module, this module declares them as HIDE
for the OS versions prior to when the move happened. On the other hand, the
original module should declare ADD them for these OS versions. An executable
can choose the right library to link against depending on the deployment target.
This is a walk-around that linker directives cannot specify other install
name per symbol, we should eventually remove this.
2019-12-13 17:22:00 -08:00
Xi Ge
5d9e7b9e78 [test] TBD: add a tbd gen test for generating linker directives 2019-12-12 22:22:28 -08:00
Harlan Haskins
3745dcc3e4 [TBDGen] Match TAPI's truncation behavior for dylib versions
TAPI and the linker truncate individual version components to 255 if
they overflow, because the linker packs 3 version components into a
32-bit int. Make sure we use the same parsing routines as TAPI.

Fixes rdar://57043178
2019-11-11 15:11:19 -08:00
Harlan Haskins
e69fa3bcf5 Merge pull request #27746 from harlanhaskins/away-in-a-mangler
[TBDGen] Mangle symbols before putting them in the TBD
2019-10-17 14:23:03 -07:00
Harlan Haskins
f3ecb56764 Merge pull request #27747 from harlanhaskins/one-easy-installment
[TBDGen] Skip non-inlinable function bodies in InstallAPI
2019-10-17 12:42:01 -07:00
Harlan Haskins
4389c5a103 [TBDGen] Use TAPI's defaults for compatibility_version and current_version
Stop hard-coding the default to 1.0.0 for dylibs and let TAPI pick the
right one.
2019-10-17 11:17:27 -07:00
Harlan Haskins
104a568222 [TBDGen] Skip non-inlinable function bodies in InstallAPI
For now, until we figure out the right way to present
-experimental-skip-non-inlinable-function-bodies, make
-tbd-is-installapi imply that, for testing.
2019-10-17 10:25:44 -07:00
Harlan Haskins
c94b952a54 [TBDGen] Mangle symbols before putting them in the TBD
The linker expects to see mangled symbols in the TBD, otherwise it won't
be able to link anything. Use LLVM's mangler to mangle them.

Fixes rdar://54055049
2019-10-16 18:50:54 -07:00
Cyndy Ishida
e6b3fd4bcd [TBDGen] disable tests on linux 2019-09-25 13:11:14 -07:00
Doug Gregor
9b20012ee1 Merge pull request #27322 from DougGregor/property-wrapper-composition-di
[DI] Support definite initialization for composed property wrappers.
2019-09-24 21:22:43 -07:00
Harlan Haskins
ccd534d139 [TBD] Ensure swift-abi-version is kept in sync with IRGen (#27347)
The TAPI_SWIFT_ABI_VERSION macro was never updated in sync with
IRGen::swiftVersion, so just expose that value through
irgen::getSwiftABIVersion() and use it in TBDGen.

Fixes rdar://55643763
2019-09-24 18:48:29 -07:00
Harlan Haskins
29bc645104 [TBDGen] Set installapi flag only when building in installapi (#27315)
Previously, we would unconditionally set the `installapi` flag, which
hard errors when trying to merge with a TAPI-generated TBD file that
was generated during the install phase.

Fixes rdar://42406088
2019-09-24 09:52:12 -07:00
Doug Gregor
a1541a19df [TBDGen] Only emit backing initializer for non-resilient properties. 2019-09-24 09:11:54 -07:00
Doug Gregor
4ba1833ca2 [TBDGen] Emit property wrapper backing initializer symbol 2019-09-24 09:11:54 -07:00
Slava Pestov
c3fefc0280 TBD: Be sure to visit enum element default arguments
Enum element default arguments is a recent addition to the language.
With -enable-testing, default arguments can have public linkage.

Fixes <rdar://problem/53948283>.
2019-08-05 15:35:18 -04:00
Joe Groff
cec9e9e33a Opaque types require a newer Swift runtime.
Check the availability of decls that declare an opaque return type to ensure they deploy to a
runtime that supports opaque types.

rdar://problem/50731151
2019-05-15 11:39:53 -07:00
Joe Groff
a99716bbb8 Visit var/subscript opaque return decls during IRGen/TBDGen. 2019-04-17 14:46:22 -07:00
Joe Groff
733b08bdf0 TBD: Include opaque type descriptors 2019-04-17 14:46:21 -07:00
Arnold Schwaighofer
051a6abe49 Default argument generator functions are not dynamically replaceable for now 2019-03-18 11:20:10 -07:00
Slava Pestov
1159af50d9 Rename -enable-resilience to -enable-library-evolution and make it a driver flag
Fixes <rdar://problem/47679085>.
2019-03-14 22:24:26 -04:00
Saleem Abdulrasool
b212229db1 test: add and use prefix substitutions for libraries
The naming convention is different on Windows than on Unix-like
environments.  In order to follow the convention we need to substitute
the prefix and the suffix.  Take the opportunity to rename the
`target-dylib-extension` to the CMake-like variable
`target-shared-library-suffix` and introduce
`target-shared-library-prefix`.  This helps linking the test suite
binaries on Windows.
2018-12-11 15:56:06 -08:00
Erik Eckstein
39bb14b094 change mangling prefix from $S to $s
This is the final ABI mangling prefix

rdar://problem/38471478
2018-09-19 13:55:11 -07:00
Harlan
096e6adb3f [TBDGen] Fix check for global accessors (#18883)
Previously, TBDGen skipped emitting lazy initializers for globals that
appeared in any file with an entry point. This breaks, however on files
that have an NSApplicationMain/UIApplicationMain class in them, where
the entry point is synthesized but top-level globals are not locally
scoped. This change re-uses SILGen's check and only skips variable
declarations that appear at top level in a script mode file.

Resolves rdar://43549749
2018-08-21 18:22:59 -07:00
Harlan Haskins
aa0d94feb1 [TBDGen] Respect app extension safety in TBD files 2018-08-20 13:07:35 -07:00
Harlan Haskins
75e219543e [TBDGen] Enable TBD generation after -typecheck 2018-08-15 15:33:26 -07:00
Harlan
7318efe49d [TBDGen] Allow user-provided dylib version flags (#18716)
* [TBDGen] Allow user-provided dylib version flags

This patch adds two frontend arguments, -tbd-compatibility-version and
-tbd-current-version, both of which accept SemVer versions.

These will show up in the generated TBD file for a given module as

current-version: 2.7
compatibility-version: 2.0

These flags both default to `1.0.0`.

* Reword some comments

* Add test for invalid version string

* Expand on comments for TBD flags
2018-08-15 11:42:42 -07:00