Makes the BSD and `__APPLE__` branches consistent and suppresses the following
warning:
```
warning: pointer is missing a nullability type specifier
```
Merge conflict while removing `nocapture` from
`s21move_function_dbginfo20addressOnlyValueTestyyxAA1PRzlF`. Resolution
was to remove nocapture from the expected output in both cases:
```
// CHECK-LABEL: define swiftcc void @"$s21move_function_dbginfo20addressOnlyValueTestyyxAA1PRzlF"(ptr noalias[-nocapture-] %0, ptr %T, ptr %T.P)
```
Conflict cause: 4858cb6225
This is the same as the original change to this file. The conflict seems
to be due to the next line changing, when moving from llvm.dbg.addr to
llvm.dbg.value.
Conflicts:
test/DebugInfo/move_function_dbginfo.swift
64-bit Windows defines both _WIN64 and _WIN32, so the logic here would
always end up defining 32-bit C types for Swift's `Int` and `UInt`.
Fix the ordering to check for 64-bit first, then 32-bit second.
Note that the SwiftShims version of this code has always been wrong,
but it's completely benign because SwiftShims is only used in the
Swift runtime itself, which is built with Clang (on all platforms),
and doesn't need to go through this code path. Still, we fix it in both
places, so we don't get a nasty surprise if the SwiftShims version of
the header later gets included in a non-Clang C++ compiler.
Header search path for Swift shims is "usr/lib/swift". Don't rely on
clang looking for module maps in immediate subdirectories like "shims"
but add a module map to "usr/lib/swift" sourcing "shims" modules.
rdar://106677321
As a result of https://github.com/llvm/llvm-project/commit/e1b88c8a09be
we should expect it to contain only the major version, not the full one
-- that is, we should expect it to be
```
../lib/clang/CLANG_VERSION_MAJOR
```
instead of
```
../lib/clang/CLANG_VERSION_MAJOR.CLANG_VERSION_MINOR.CLANG_VERSION_PATCH
```
Also update the logic to levarage directly the Clang version -- this can
be different from the LLVM one (as per
ebfc680685)
Addresses rdar://111452821
As of CMake 3.25, there are now global variables `LINUX=1`, `ANDROID=1`,
etc. These conflict with expressions that used these names as unquoted
strings in positions where CMake accepts 'variable|string', for example:
- `if(sdk STREQUAL LINUX)` would fail, because `LINUX` is now defined and
expands to 1, where it would previously coerce to a string.
- `if(${sdk} STREQUAL "LINUX")` would fail if `sdk=LINUX`, because the
left-hand side expands twice.
In this patch, I looked for a number of patterns to fix up, sometimes a
little defensively:
- Quoted right-hand side of `STREQUAL` where I was confident it was
intended to be a string literal.
- Removed manual variable expansion on left-hand side of `STREQUAL`,
`MATCHES` and `IN_LIST` where I was confident it was unintended.
Fixes#65028.
Using `SwiftShims` is undesirable - it creates all kinds of build issues,
and means shipping the `_SwiftBacktracing.h` header in the SDK, which is
not necessary.
While we're doing this, add the necessary definitions for reading ELF
and DWARF information.
rdar://110261712
Use `task_read_for_pid()` rather than having the crashing program pass its
own task port through. This opts us in to additional OS security measures
surrounding the use of this call.
rdar://107362003
This ensures that a module built from Swift interface file (and as such interop is disabled),
that references 'exit' (from _SwiftConcurrencyShims module) can resolve the module reference to
'exit' even when it's being imported when interop is enabled (and thus it loads a different underlying _SwiftConcurrencyShims).
This is needed because we can't include `<stdint.h>` or `<inttypes.h>`
on Darwin without dragging in the Darwin package.
The previous solution was some icky `#define` nonsense. This is
better.
rdar://106234311
Adds a new swift_Backtracing library, with a corresponding _Backtracing
module, to the build. Also add some tests.
This is not public API at this point, but will be used by the external
backtracing program, `swift-backtrace`.
rdar://104336548
In order for the runtime PR to work as a separate PR, it does need a little
bit of code in the `_SwiftBacktracing.h` header in SwiftShims.
rdar://105391747
* Move Runtime into _Runtime
Fix more _Runtime names
* Add availability to all API
* Build _Runtime and Reflection modules
* Use threading's mutex for all platforms
add stdlib include