Commit Graph

79 Commits

Author SHA1 Message Date
swift-ci
85959f9014 Merge remote-tracking branch 'origin/main' into rebranch 2021-01-11 05:32:52 -08:00
martinboehme
c5b7e7fb9c Fix two issues with the SwiftGlibc module map (#32404)
* Fix two issues with the SwiftGlibc module map.

The issues are:

- Today, some submodules in `SwiftGlibc` fail to provide definitions that
  they should contain. As a consequence, Swift fails to import some code
  that compiles correctly with standalone Clang. As just one example,
  including `signal.h` should make the type `pid_t` available, but it
  currently does not.

- `SwiftGlibc` is not compatible with the libc++ module map. Trying to
  include libc++ headers in a C++ module imported into Swift results in an
  error message about cyclic dependencies.

This change fixes both of these issues by making it so that `SwiftGlibc`
no actually longer defines a module map for the glibc headers but merely makes
all of the symbols from those headers available in a module that can be
imported into Swift. C / Objective-C / C++ code, on the other hand, will now
include the glibc headers texually.

For more context on the two issues and this fix, see this forum
discussion:

https://forums.swift.org/t/problems-with-swiftglibc-and-proposed-fix/37594

This change only modifies `glibc.modulemap.gyb` for the time being but
leaves `bionic.modulemap.gyb` and `libc-openbsd.modulemap.gyb` unchanged. The
intent is to fix these in the same way, but it will be easier to do this
in separate PRs that can be tested individually.

Co-authored-by: zoecarver <z.zoelec2@gmail.com>
Co-authored-by: Marcel Hlopko <hlopko@google.com>
2021-01-11 14:25:41 +01:00
swift_jenkins
fc33a461de Merge remote-tracking branch 'origin/main' into next 2020-12-15 00:46:51 -08:00
Marcel Hlopko
bde9c3b683 [cxx-interop] Fix header guards in test/Interop (#35039) 2020-12-15 09:20:19 +01:00
swift_jenkins
669fb36333 Merge remote-tracking branch 'origin/main' into next 2020-12-10 23:32:30 -08:00
martinboehme
f4e74f7907 When qualifying Clang types with a module, make sure we choose a visible module (#32465)
Clang types need special treatment because multiple Clang modules can contain the same type declarations from a textually included header, but not all of these modules may be visible.

This fixes
https://bugs.swift.org/browse/SR-13032

The newly added test breaks without this fix.
2020-12-11 08:15:05 +01:00
swift_jenkins
aacd03933a Merge remote-tracking branch 'origin/main' into next 2020-12-10 06:05:40 -08:00
scentini
4f3f68ea48 Amend test to actually fail due to SR-13032 (#35038) 2020-12-10 15:02:28 +01:00
Arnold Schwaighofer
cdf9890a12 Fix Interop tests for latest LLVM 2020-12-03 10:15:24 -08:00
Robert Widmann
356946f0c0 Merge pull request #34476 from scentini/implementation-only-symbol-visibility-fix
[cxx-interop] Fix SR-13785
2020-11-30 10:07:11 -08:00
zoecarver
e639caeeea [cxx-interop] Bail on redefined macros.
This is a stop-gap fix to prevent an infinite loop. Refs SR-13828.
2020-11-11 11:08:40 -08:00
Rosica Dejanovska
1a18225ef9 Polish PR 2020-11-10 11:22:38 +01:00
Rosica Dejanovska
3ca701e561 Change logic for visible decls lookup 2020-11-06 14:46:25 +01:00
Rosica Dejanovska
81c0721633 Format files 2020-10-29 17:16:12 +01:00
Rosica Dejanovska
679ce361aa Add more tests 2020-10-29 16:55:10 +01:00
Rosica Dejanovska
e20b0f8744 Minor fixes 2020-10-29 12:47:19 +01:00
Rosica Dejanovska
53c4393f56 Fix SR-13785 2020-10-29 12:44:22 +01:00
Rosica Dejanovska
00d4d11802 Fix header guards 2020-10-29 12:40:40 +01:00
Rosica Dejanovska
954d3e6e42 Add a test that verifies that Swift correctly recognizes symbol visibility when dealing with @_implementationOnly imports 2020-10-29 12:39:50 +01:00
scentini
64e5f763e6 Add a failing test for SR-13785 (#34462)
* Add a test that verifies that Swift correctly recognizes symbol visibility when dealing with @_implementationOnly imports

* Fix header guards
2020-10-28 14:36:27 +01:00
scentini
9f8b966058 Add a test that checks that ClangImporter chooses only exported modules (#34392) 2020-10-23 10:34:44 +02:00
Daniel Duan
942893d7a6 ClangImporter: Preserve CChar type (#32692)
Addresses SR-466.
2020-07-08 10:18:58 -07:00
Dmitri Gribenko
61d4793970 Added tests for edge cases in importing and mangling C structs
Some of the patterns in the new test header are special-cased by
ClangImporter (for example, the names of typedefs become names of
imported structs).

Nested structs have been historically imported in Swift according to C
rules, that is, structs lexically declared nested in other structs are
imported into the global namespace anyway. For the same reason, C
structs have been mangled in Swift names as if they are declared in the
global namespace. These rules are problematic when importing C++, see
https://bugs.swift.org/browse/SR-12803.
2020-05-15 18:50:19 +02:00
Marcel Hlopko
2fbcf184ed Add header guards to test/Interop 2020-04-30 16:13:33 +02:00
Martin Boehme
f2bfa262b4 Fix "CXX-DAG" lines mistakenly renamed to "CXX-DOG" for testing. 2020-04-20 15:12:18 +02:00
Martin Boehme
78688925f5 Make tests pass under Darwin and Windows. 2020-04-20 14:06:13 +02:00
Martin Boehme
d98f8d3a3d Also emit inline functions that are used in variable initializers. 2020-04-17 12:53:06 +02:00
Martin Boehme
e9ca0c74dc Responses to review comments by @gribozavr. 2020-04-16 19:26:18 +02:00
Martin Boehme
35f8ef50f8 More reponses to review comments by @gribozavr.
One larger change is that we're now also running this test in C as well
as C++.
2020-04-15 14:44:31 +02:00