When it's available, use an open-coded allocator function that returns
an alloca without popping if the allocator is nullptr and otherwise
calls swift_coro_alloc. When it's not available, use the malloc
allocator in the synchronous context.
This allows external tools to locate the metadata pointer without needing to call the accessor function.
This is only useful for non-generic types, so we borrow the HasCanonicalMetadataPrespecializations flag to indicate the presence of this pointer on non-generic types, and it continues to indicate the presence of prespecializations for generic types.
Only emit this pointer for internal/private types with no runtime initialization. Public type metadata can be found with the symbol, and it's not useful for types that require runtime initialization.
This patch adds support for emitting the flag
llvm::DINode::FlagAllCallsDescribed when generating LLVM IR from the
Swift compiler to get call-site information for swift source code.
With the acceptance of SE-0458, allow the use of unsafe expressions, the
@safe and @unsafe attributes, and the `unsafe` effect on the for..in loop
in all Swift code.
Introduce the `-strict-memory-safety` flag detailed in the proposal to
enable strict memory safety checking. This enables a new class of
feature, an optional feature (that is *not* upcoming or experimental),
and which can be detected via `hasFeature(StrictMemorySafety)`.
When TMO is enabled, change IRGen to pass the newly introduced runtime function `swift_coroFrameAlloc` (and pass an additional argument — the hash value) instead of `malloc` when it inserts calls to `coro_id_retcon_once`.
The hashValue is computed based on the current function name (computed in `getDiscriminatorForString`)
rdar://141235957
* Revert "[CSOptimizer] Look through `OptionalEvaluationExpr`s when dealing with unapplied disjunctions"
This reverts commit 72340f39b8.
* Revert "[CSOptimizer] Don't consider disabled overloads when checking whether disjunction is supported"
This reverts commit 6bc23b5057.
* Revert "[CSOptimizer] Disjunctions with IUO overload choices are unsupported"
This reverts commit 471ee21535.
* Revert "[CSOptimizer] MemberImportVisibility: Don't consider overloads that come from implicit imports"
This reverts commit aa4a2b9071.
* Revert "[CSOptimizer] Don't consider CGFloat widening when explicit initializer is used"
This reverts commit 3cc76eacdd.
* Revert "[CSOptimizer] Literal arguments should cause score reset only for operators"
This reverts commit e3987beffb.
* Revert "[CSOptimizer] NFC: check whether a choice is of operator instead of whole disjunction"
This reverts commit 6c82892c3c.
* Revert "[CSOptimizer/Tests] NFC: Add a perf test-case fixed by improved literal array handling"
This reverts commit cfd34e54c4.
* Revert "[CSOptimizer] Extend candidate/parameter matching to support array literals"
This reverts commit 8a304f88c6.
* Revert "[CSOptimizer] Favor choices that don't require application"
This reverts commit 0737542da8.
* Revert "[CSOptimizer] Disable CGFloat -> Double conversion for unary operators"
This reverts commit bc3a15fbe6.
* Revert "[CSOptimizer] Mark bitwise operators as supported"
This reverts commit 860ae08d1b.
* Revert "[CSOptimizer] Simplify handling of non-applied disjunctions"
This reverts commit 43ca7dfff9.
* Revert "[ConstraintSystem] Fix `getEffectiveOverloadType` handling of `mutating` methods"
This reverts commit c767f7aff7.
* Revert "[CSOptimizer] Reduce overload types before ranking"
This reverts commit 95b47aead6.
* Revert "[CSOptimizer] Implement special prioritization rules for result builder contexts"
This reverts commit 56d6635e46.
* Revert "[CSOptimizer] Allow only widening CGFloat->Double conversions while matching candidate arguments"
This reverts commit bf8ae3bc1b.
* Revert "[CSSimplify] CGFloat-Double: Rank narrowing correctly when result is injected into an optional"
This reverts commit cb876cbd9e.
* Revert "[CSBindings] Prevent `BindingSet::isViable` from dropping viable bindings (v2)"
This reverts commit b7e7493076.
* Revert "[CSOptimizer] Add support for chained members without arguments"
This reverts commit 87cd5f8733.
* Revert "[CSOptimizer] Mark compiler synthesized disjunctions as optimized"
This reverts commit 867e64182f.
* Revert "[CSOptimizer] Make a light-weight generic overload check if some requirements are unsatisfiable"
This reverts commit 15c773b9d7.
* Revert "[CSOptimizer] Fix `selectDisjunction` to use favored choices even if disjunction was not optimized"
This reverts commit c2a55886f0.
* Revert "[CSOptimizer] Limit "old" behavior compatibility to unlabeled unary arguments"
This reverts commit 9fb73143f6.
* Revert "[Tests] NFC: Update a couple of type-checker tests"
This reverts commit ff8663ff16.
* Revert "[Tests] NFC: Move simd related test-case from `slow` to `fast`"
This reverts commit 28396a6dce.
* Revert "[CSGen] NFC: Remove obsolete `ConstraintSystem::{get, set}FavoredType`"
This reverts commit 8bd288447f.
* Revert "[CSOptimizer] Allow literal arguments to match parameters that conform to `ExpressibleBy{Integer, Float}Literal`"
This reverts commit 2fdd4b6c35.
* Revert "[CSOptimizer] Adjust `scoreCandidateMatch` to indicate when match cannot be decided"
This reverts commit 9b62c84a4f.
* Revert "[CSOptimizer] Fix Double<->CGFloat implicit conversion support when arguments are literals"
This reverts commit 6caf1ccbb2.
* Revert "[CSOptimizer] A more comprehensive generic overload checking when candidates are fully resolved"
This reverts commit e30587bda4.
* Revert "[CSOptimizer] Restore old hack behavior which used to favor overloads based on arity matches"
This reverts commit a3a3ec4fe0.
* Revert "[CSOptimizer] Desugar types before checking for equality"
This reverts commit 802f5cd105.
* Revert "[ConstraintSystem] Narrowly disable `tryOptimizeGenericDisjunction` when some of the arguments are number literals"
This reverts commit 8d5cb112ef.
* Revert "[CSOptimizer] Infer argument candidates from calls to `Double` and CGFloat constructors"
This reverts commit f2a6677a6d.
* Revert "[CSOptimizer] Score all of the overload choices matching on literals uniformly"
This reverts commit 59109c2d60.
* Revert "[CSOptimizer] Enable ranking of `Int*`, `Float{80}` and `Double` initializers"
This reverts commit 6fb6d1cf90.
* Revert "[CSOptimizer] Rank disjunctions based on score only if both sides are supported"
This reverts commit 8818d399f9.
* Revert "[CSOptimizer] Rank results of operators regardless of whether anything is known about parameters"
This reverts commit 3996b25fbd.
* Revert "[Tests] NFC: Add more test-cases that were previously solved due to old hacks behavior"
This reverts commit d0ff6c81b8.
* Revert "[CSOptimizer] Average score should reflect number of defaulted parameters"
This reverts commit 23589add74.
* Revert "[Tests] NFC: Adjust a couple of improved tests"
This reverts commit 66981364fe.
* Revert "[CSOptimizer] Don't optimize (implicit) calls with code completion arguments"
This reverts commit 8a918e2369.
* Revert "[CSOptimizer] attempt to rank only standard/simd operators and fully concrete overload sets"
This reverts commit deca9b61c5.
* Revert "[CSOptimizer] Record best scores for each disjunction and use them in `selectDisjunction`"
This reverts commit 3819ddfb40.
* Revert "[CSOptimizer] Let `determineBestChoicesInContext` return the best disjunction if one is available"
This reverts commit cf05405eae.
* Revert "[CSOptimizer] Emulate old behavior related to favoring of unary calls to members"
This reverts commit 527de22bec.
* Revert "[Tests] NFC: Add a test-case for rdar://133340307 which is now fast"
This reverts commit 670127abd6.
* Revert "[CSOptimizer] Prefer homogeneous arithmetic operator overloads when argument(s) or result match"
This reverts commit d69b6a0594.
* Revert "[CSOptimizer] Remove an outdated optimization to compare resolved argument types with all else equal"
This reverts commit 1760bd1f1e.
* Revert "[CSOptimizer] NFC: Switch from llvm::Optional to std::optional post-rebase"
This reverts commit c429f5b9ec.
* Revert "[CSOptimizer] Increase score when type matches opaque type"
This reverts commit 2869dff995.
* Revert "[CSOptimizer] NFC: Switch to llvm::Optional"
This reverts commit 0fc6806922.
* Revert "[CSOptimizer] NFC: Adjust conformance check to use `ConstraintSystem::lookupConformance`"
This reverts commit da65333d41.
* Revert "[CSOptimizer] Treat all type parameters equally"
This reverts commit 957a5f4270.
* Revert "[CSStep] Remove disjunction pruning logic from DisjunctionStep"
This reverts commit 2c44e37948.
* Revert "[CSOptimizer] Relax candidate type requirements from equality to set of no-impact conversions"
This reverts commit 11b897b32f.
* Revert "[CSOptimizer] Use `matchCallArguments` to establish argument-to-parameter relationships"
This reverts commit cb1cb2018d.
* Revert "[CSOptimizer] Don't attempt to optimize calls with code completion token(s) in argument position"
This reverts commit 14e2a16fce.
* Revert "[CSOptimizer] Allow generic operator overloads without associated type parameters"
This reverts commit bc5f70a9a3.
* Revert "[CSOptimizer] Make sure that all parameters without arguments are defaulted"
This reverts commit 7c1c46d4e4.
* Revert "[CSStep] Don't favor choices until the disjunction is picked"
This reverts commit e404ed722a.
* Revert "[CSOptimizer] Keep track of mismatches while evaluating candidates"
This reverts commit a094c3ebb0.
* Revert "[CSOptimizer] Favor SIMD related arithmetic operator choices if argument is SIMD<N> type"
This reverts commit c2f7451c7b.
* Revert "[CSOptimizer] Initial implementation of disjunction choice favoring algorithm"
This reverts commit 672ae3d252.
* Revert "[ConstraintSystem] Add skeleton of constraint optimizer"
This reverts commit b5f08a4009.
* Revert "[CSGen] Remove ConstraintOptimizer and all favoring logic"
This reverts commit 4432c51f57.
* Revert "[ConstraintSystem] Remove `shrink`"
This reverts commit 757ca24e8a.
* [TypeChecker] NFC: Remove resurrected use of `SolverShrinkUnsolvedThreshold`
* [TypeChecker] Bring back `SolverDisableShrink`
* [Tests] NFC: Mark tests affected by solver-perf revert as slow
* [Tests] NFC: Adjust async tests that are affected by performance hacks
This flag is unsafe since the compiler does not verify that the resulting
public interface will compile with the module import removed. The modern
alternative to this flag is `@_spiOnly import`. Since the flag is no longer
used by any projects it should be removed.
Resolves rdar://134351088.
IterableDeclContext::checkDeserializeMemberErrorInPackage recursively checks if
decls and their member decls are deserialized correctly into another module.
This PR adds a check to make sure the inspected decls are from another module,
and provides an opt-in flag to fail fast on deserialization failure if found.
rdar://143830240
Add ability to automatically chaining the bridging headers discovered from all
dependencies module when doing swift caching build. This will eliminate all
implicit bridging header imports from the build and make the bridging header
importing behavior much more reliable, while keep the compatibility at maximum.
For example, if the current module A depends on module B and C, and both B and
C are binary modules that uses bridging header, when building module A,
dependency scanner will construct a new header that chains three bridging
headers together with the option to build a PCH from it. This will make all
importing errors more obvious while improving the performance.
Batch dependency scanning was added as a mechanism to support multiple compilation contexts within a single module dependency graph.
The Swift compiler and the Explicitly-built modules model has long since abandoned this approach and this code has long been stale. It is time to remove it and its associated C API.
Instead of requested action. In implicit builds, implicit interface build sub-invocations inherit their parent invocation's requested action, which the code was failing to detect that we were building an interface, not source, and erroneously resulted in enabling in-package module dependency resolution.
Resolves rdar://143505814
We're not planning on removing the splitter because it is a big win
in some cases, but we want to run it less often since it can also
be a source of overhead. This flag allows us to compare performance
to understand the tradeoffs better.
Parsing for `-enable-upcoming-feature` and `-enable-experimental-feature` is
lenient by default because some projects need to be compatible with multiple
language versions and compiler toolchains simultaneously, and strict
diagnostics would be a nuisance. On the other hand, though, it would be useful
to get feedback from the compiler when you attempt to enable a feature that
doesn't exist. This change splits the difference by introducing new diagnostics
for potential feature enablement misconfigurations but leaves those diagnostics
ignored by default. Projects that wish to use them can specify `-Wwarning
StrictLanguageFeatures`.
Diagnostics may be emitted while parsing command line arguments. This implies
that the options which affect how diagnostics are emitted and presented need to
be parsed first.
decl being accessed is correct. When this assumption fails due to a deserialization error
of its members, the use site accesses the layout with a wrong field offset, resulting in
UB or a crash. The deserialization error is currently not caught at compile time due to
LangOpts.EnableDeserializationRecovery being enabled by default to allow for recovery of some
of the deserialization errors at a later time. In case of member deserialization, however,
it's not necessarily recovered later on.
This PR tracks whether member deserialization had an error by recursively loading members and
checking for deserialization error, and fails and emits a diagnostic. It provides a way to
prevent resilience bypassing when the deserialized decl's layout is incorrect.
Resolves rdar://132411524
Add a -nostdlibimport (analagous to clang's -nostdlibinc) to remove the SDK paths from the import search paths, but leave the toolchain paths.
rdar://139322299
When Swift passes search paths to clang, it does so directly into the HeaderSearch. That means that those paths get ordered inconsistently compared to the equivalent clang flag, and causes inconsistencies when building clang modules with clang and with Swift. Instead of touching the HeaderSearch directly, pass Swift search paths as driver flags, just do them after the -Xcc ones.
Swift doesn't have a way to pass a search path to clang as -isystem, only as -I which usually isn't the right flag. Add an -Isystem Swift flag so that those paths can be passed to clang as -isystem.
rdar://93951328
This teaches Swift to rebuild the CxxStdlib overlay module from its interface when using a C++ standard library that is not the platform default, specifically libc++ on Linux.
rdar://138838506