Commit Graph

24 Commits

Author SHA1 Message Date
Tony Allevato
d94bd80c62 Add support for raw identifiers.
Raw identifiers are backtick-delimited identifiers that can contain any
non-identifier character other than the backtick itself, CR, LF, or other
non-printable ASCII code units, and which are also not composed entirely
of operator characters.
2025-03-11 17:18:43 -04:00
Alastair Houghton
2297c3f5b6 [Build][Test] Fix TypeRoundTrip/round-trip.swift.
`TypeRoundTrip/round-trip.swift` tries to link with `libswiftRemoteInspection`,
but that library isn't in the default link path, so we need to add a `-L`
option to the command line in the test.

Also, we should check that `SWIFT_BUILD_REMOTE_MIRROR` is enabled and
disable the test if not, because otherwise `libswiftRemoteInspection` won't
have been built.

rdar://123503470
2024-05-06 08:46:05 +01:00
Ben Barham
ef8825bfe6 Migrate llvm::Optional to std::optional
LLVM has removed llvm::Optional, move over to std::optional. Also
clang-format to fix up all the renamed #includes.
2024-02-21 11:20:06 -08:00
Erik Eckstein
712fd7922b Merge remote-tracking branch 'origin/main' into rebranch 2023-01-09 08:48:47 +01:00
Alejandro Alonso
382510fa50 Rename Reflection library to RemoteInspection (#62846) 2023-01-06 13:21:32 -05:00
Erik Eckstein
dddb6101ae tests: TypeRoundTrip/round-trip.swift needs to be compiled with C++17 2022-11-15 17:23:08 +01:00
Anthony Latsis
90453886f7 Merge pull request #60957 from AnthonyLatsis/migrate-test-suite-to-gh-issues-23
Gardening: Migrate test suite to GH issues p. 23
2022-09-22 04:29:32 +03:00
Egor Zhdan
84a1ffcb33 [Shims] Include SwiftShims headers without ../
This replaces a number of `#include`-s like this:
```
#include "../../../stdlib/public/SwiftShims/Visibility.h"
```
with this:
```
#include "swift/shims/Visibility.h"
```

This is needed to allow SwiftCompilerSources to use C++ headers which include SwiftShims headers. Currently trying to do that results in errors:
```
swift/swift/include/swift/Demangling/../../../stdlib/public/SwiftShims/module.modulemap:1:8: error: redefinition of module 'SwiftShims'
module SwiftShims {
       ^
Builds.noindex/swift/swift/bootstrapping0/lib/swift/shims/module.modulemap:1:8: note: previously defined here
module SwiftShims {
       ^
```
This happens because the headers in both the source dir and the build dir refer to SwiftShims headers by relative path, and both the source root and the build root contain SwiftShims headers (which are equivalent, but since they are located in different dirs, Clang treats them as different modules).
2022-09-14 11:14:50 +01:00
Anthony Latsis
c7a316727c Gardening: Migrate test suite to GH issues: TypeRoundTrip 2022-09-06 15:08:57 +03:00
Alastair Houghton
f5bdb858e0 [Threading] Create new threading library and use it.
Moved all the threading code to one place.  Added explicit support for
Darwin, Linux, Pthreads, C11 threads and Win32 threads, including new
implementations of Once for Linux, Pthreads, C11 and Win32.

rdar://90776105
2022-06-07 07:39:51 +01:00
Alex Hoppen
4aa2bbbf06 Revert "Merge pull request #42447 from al45tair/eng/PR-90776105"
This reverts commit 8bcb71140f, reversing
changes made to c4dd271d36.
2022-06-02 18:03:23 +02:00
Alastair Houghton
63a09007a1 [Threading] Create new threading library and use it.
Moved all the threading code to one place.  Added explicit support for
Darwin, Linux, Pthreads, C11 threads and Win32 threads, including new
implementations of Once for Linux, Pthreads, C11 and Win32.

rdar://90776105
2022-05-24 14:57:39 +01:00
Slava Pestov
e24031012f RequirementMachine: Disable merged associated types by default
This feature allows the following construct to work:

    protocol P1 {
      associatedtype T : P1
    }

    protocol P2 {
      associatedtype T : P2
    }

    func foo<T : P1 & P2>(_: T) {}

However, I haven't figured out how to make it work with rewrite system
minimization, so it's already disabled when you use the requirement
machine for protocol or generic signature minimization. In addition to
that it adds some complexity.

I haven't found any real-world uses of this pattern yet, so I'm going
to try to turn it off, and if nobody complains, remove the support
altogether.

If people do complain, we'll have to figure out how to make it work with
minimization.
2022-01-25 11:38:50 -05:00
Alastair Houghton
9013083046 [Demangler] Display error codes in various places.
Also fixed a test that broke with the previous commit.

rdar://79725187
2021-09-06 17:49:55 +01:00
Alastair Houghton
cc869b90b1 [Demangling] Remangling error handling for the OldRemangler.
First pass at adding error handling to the OldRemangler.  Still pondering
assert() calls.

rdar://79725187
2021-09-06 17:49:09 +01:00
Alastair Houghton
fbf082b6cb [Demangling] Make Demangle::getUnspecialized() return errors too.
This lets us completely remove the unreachable() function from Remangler.cpp.

rdar://79725187
2021-09-06 17:49:09 +01:00
David Zarzycki
9043c7d0a2 [testing] Add missing -lm 2021-08-27 06:27:52 -04:00
Alastair Houghton
fe3d329c00 [Tests] Mark TypeRoundTrip as unsupported on use_os_stdlib.
When use_os_stdlib is set, we use the system Swift libraries, rather than
the ones we've just built.  Older Swift libraries don't have some of the
required functions to run this test, and since the test is supposed to be
testing the library rather than the compiler, it makes sense to just mark
it as unsupported in that configuration.
2021-08-23 12:43:57 +01:00
Alastair Houghton
785543a597 [Tests] Avoid a compiler/runtime bug that breaks the build on Linux.
Apparently we can write a type with @convention(block) on Linux, which is
entertaining because when we touch the metadata for such a thing in the
runtime, we fail with an assert(), assuming assertions are enabled.
2021-08-18 21:18:46 +01:00
Alastair Houghton
642b93d380 [Tests] Fix round-trip test to build with target libraries.
The round-trip test was relying on a host library, but that only works where
we aren't cross-compiling.  Using a target library instead was a little more
complicated than it looked because libswiftDemangling doesn't get built for
the target.  However, it *is* part of the other Swift libraries on the host,
but there's an extra namespace shoehorned in.
2021-08-17 17:52:50 +01:00
Alastair Houghton
232b538082 [Tests] Fix opaque return type test to work on iOS et al.
Needed to expand the availability checks for other platforms.
2021-08-17 14:26:09 +01:00
Alastair Houghton
cd99995d84 [Tests] Re-add round-trip type test.
This was reverted in 12fa024 because it broke the iOS simulator build.

rdar://37170485
2021-08-17 09:51:22 +01:00
Mishal Shah
f45195454f Revert "[Tests] Add a test to round-trip types through mangled names." 2021-08-16 14:03:39 -07:00
Alastair Houghton
8e12cd0b62 [Tests] Add a test to round-trip types through mangled names.
Added a new test to the test suite that round trips Swift types through
mangled names and checks that we get the same type back that we started
with.

rdar://37170485
2021-08-16 11:22:21 +01:00