Skip to content

[android] Update tests to use new Android overlay and disable stdlib/Glibc.swift #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

finagolfin
Copy link

Also, rebased against trunk.

kubamracek and others added 30 commits December 13, 2023 10:48
Changes in this CR add part of the, Swift based, Autodiff specific
closure specialization optimization pass. The pass does not modify any
code nor does it even exist in any of the optimization pipelines. The
rationale for pushing this partially complete optimization pass upstream
is to keep up with the breaking changes in the underlying Swift based
compiler infrastructure.
This adds a `getSpareBits` method to all the TypeInfo classes
that returns a suitable bitmask indicating the spare bits available
in values of this type.  This gives us a way to recursively explore
the type tree and build up a full spare bit mask for an arbitrary type.

Happily, it appears we actually do have enough information to do this
calculation entirely from first principles, without requiring additional
reflection information.  So once this is stable, we should remove my
earlier incomplete effort to publish spare bit mask info in the reflection
data, as that adds unnecessary metadata to every binary.

This doubtless still has plenty of holes, but seems sufficient
to handle a few basic enum types, including the stdlib DecodingError
which was used as an example to work out some key issues.
… to C++

This fixes a compiler crash that happened when emitting a Clang header for a Swift module that declares multiple macros with the same base name and different argument names.

Swift macros are not currently designed to be exposed to C++. This teaches the compiler to explicitly mark them as unavailable in C++.

rdar://117969472 / resolves swiftlang#69656
A CompilerInvocation object may outlive the input argument list, so we need to copy these argument strings to avoid a use-after-free
Like `?` or property access, `x!` can be borrowing, consuming, or mutated
through depending on the use site and the ownership of the base value.
Alter SILGen to emit `x!` as a borrowing operation when the result is only
used as a borrow. Fix the move-only checker not to treat the unreachable
branch as a dead path for values and try to destroy the value unnecessarily
and possibly out-of-order with cleanups on the value. Fixes rdar://127459955.
Rather than immediately outright banning the old protocol, just make it
be a deprecated typealias for the real one.
The standard library defines
```
protocol BitwiseCopyable {}
typealias _BitwiseCopyable = BitwiseCopyable
```
For current compilers, `BitwiseCopyable` is a "known protocol".

For older compilers, it is not; instead `_BitwiseCopyable` is.  So
print the following into the swiftinterface for those older compilers:
```
protocol _BitwiseCopyable {}
typealias BitwiseCopyable = _BitwiseCopyable
```

rdar://127755503
Makes it easier to search for since editors will see it as a single
name.
This lambda has to do with availability or the lack thereof but
unreachable instructions are of interest in this context so using the
wrong name confuses things unnecessarily.
Match the declaration order.
Don't default to one boundary or another based on whether the value
being completed is lexical.
The new boundary allows for invalid OSSA where values are not consumed
on paths leading to blocks that exit the function normally.  In such
cases, the value is allowed to continue leaking as before.
Use the new AvailabilityWithLeaks boundary.
the readlink addition in f4bf278 was introduced without a corresponding include.
Bump the Yams version to 5.0.6 to support Windows arm64
…lang#73519)

* Implement Builtin.freeze for integer and integer-vector types.

https://llvm.org/docs/LangRef.html#freeze-instruction

> If the argument is undef or poison, ‘freeze’ returns an arbitrary, but fixed, value of type ‘ty’. Otherwise, this instruction is a no-op and returns the input argument. All uses of a value returned by the same ‘freeze’ instruction are guaranteed to always observe the same value, while different ‘freeze’ instructions may yield different values.

It's most importation for integer and integer-vector types because floating-point results are generally not poison (except in the case of conversion from poison integer values).
However, we might want to implement this for other types as well in the future.

* Make builtin.freeze TrivialUse

Also fix filecheck patterns for its test to work with asserts build.
This adjusts the test to be correct on 32-bit platforms.

rdar://127795392
When compiling with optimizations, the compiler might reorder some instructions, leading to test failures.

rdar://127795755
tbkka and others added 20 commits May 10, 2024 13:15
Calculate spare bits for multi-payload enums from first principles
We don't need to build a DenseMap here. More importantly, this
changes the logic to avoid calling mapTypeOutOfContext() on
element archetypes, instead doing the mapping directly.
…osures-part-4

Allow local archetypes in interface types of local declarations
[embedded] Mark test/embedded/lto-multiple-object-files.swift as REQUIRES: optimized_stdlib
…om-inherited-protocols

Infer protocol isolation from its inherited protocols.
Make SwiftValue == support unconditional
…ang#73578)

The numerics of these operations is fairly subtle, and the overflow boundaries are somewhat surprising, so additional test coverage isn't a bad thing (also gives us an excuse to exercise Int128 more)
This commit doesn't install them yet, they will be installed and a whole Android NDK module will be built in a follow-up commit

This module map covers the Bionic C standard library and other Posix headers used in the Android NDK
@finagolfin
Copy link
Author

This commit was cherry-picked into upstream pull.

@finagolfin finagolfin closed this May 28, 2024
hyp pushed a commit that referenced this pull request Jun 27, 2024
…wiftlang#73353)

Add a new demangler option which excludes a closure's type signature.

This will be used in lldb.

Closures are not subject to overloading, and so the signature will never be used to 
disambiguate. A demangled closure is uniquely identifiable by its index(s) and parent.

Where opaque types are involved, the concrete type signature can be quite complex. This 
demangling option allows callers to avoid printing the underlying complex nested 
concrete types.

Example:

before: `closure #1 (Swift.Int) -> () in closure #1 (Swift.Int) -> () in main`
after: `closure #1 in closure #1 in main`
hyp pushed a commit that referenced this pull request Jul 26, 2024
This inserts a suitably named function into the stack trace whenever
a dynamic cast failure involves a NULL source or target type.
Very often, crash logs include backtraces with function names but
no log output; with this change, such a backtrace might look like
the following -- note `TARGET_TYPE_NULL` in the function name
here to mark the missing type information:

```
 frame #0: __pthread_kill + 8
 frame #1: pthread_kill + 288
 frame swiftlang#2: abort + 128
 frame swiftlang#3: swift::fatalErrorv()
 frame swiftlang#4: swift::fatalError()
 frame swiftlang#5: swift_dynamicCastFailure_TARGET_TYPE_NULL()
 frame swiftlang#6: swift::swift_dynamicCastFailure()
 frame swiftlang#7: ::swift_dynamicCast()
```

Resolves rdar://130630157
hyp pushed a commit that referenced this pull request Sep 4, 2024
…n's demangled name when processing it in RegionAnalysis.

Just trying to improve logging to speed up triaging further. This is useful so
that I can quickly find specific closures we process by using the closure
numbering (e.x.: closure #1 in XXXX).
@finagolfin finagolfin deleted the eng/android/ndk-overlay branch October 3, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.