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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
12f8e62
[embedded] Start flagging AllocRefDynamicInst usage in embedded Swift
kubamracek Dec 13, 2023
e546684
Extract the BitMask support to a separate file
tbkka Apr 29, 2024
a7f8d6c
[Autodiff] Adds bridging code in preparation for the Swift based Auto…
jkshtj Feb 19, 2024
003c908
[Autodiff] Adds SwiftCompilerSources changes in preparation for the A…
jkshtj Feb 21, 2024
c8375c0
[Autodiff] Adds part of the closure-specialization optimization pass
jkshtj Feb 21, 2024
fd60984
Makes the swift-based closure-spec pass an experimental frontend feature
jkshtj Apr 2, 2024
546b5af
Copies over original closure-spec tests as XFAIL (when needed)
jkshtj Apr 2, 2024
c6330a7
Rev: Addressed feedback
jkshtj May 2, 2024
ea87a27
Redesign the spare bit mask calculation
tbkka Apr 29, 2024
febc128
Whitespace
tbkka May 7, 2024
961a2e2
[cxx-interop] Re-enable test for reference types in generic contexts
egorzhdan May 8, 2024
f42609b
[cxx-interop][SwiftToCxx] Do not crash while trying to expose a macro…
egorzhdan May 8, 2024
7c64093
Switch Windows search path options to std::string
z2oh May 8, 2024
82e566a
SILGen: Treat Optional `x!` force unwrapping as a forwarding operation.
jckarter May 8, 2024
6998ebd
Bump the Yams version to 5.0.6 to support Windows arm64
shahmishal May 8, 2024
acd9b72
[BitwiseCopyable] Only deprecate underscored.
nate-chandler May 8, 2024
2671652
[BitwiseCopyable] Avoid a condfail.
nate-chandler May 8, 2024
a0b8324
[Test] Used underscores in test name.
nate-chandler May 2, 2024
2ee4024
[NFC] LifetimeCompletion: operator<<(boundary).
nate-chandler May 2, 2024
de5d2ec
[NFC] LifetimeCompletion: Improve lambda name.
nate-chandler May 8, 2024
c11a2ce
[NFC] LifetimeCompletion: Fix switch order.
nate-chandler May 9, 2024
518de7c
[LifetimeCompletion] Require boundary spec.
nate-chandler May 2, 2024
6324067
[LifetimeCompletion] Add availability_with_leaks.
nate-chandler May 9, 2024
284262d
[SILGenCleanup] Handle leaky OSSA.
nate-chandler May 9, 2024
94b1348
stdlib: fix android build
hyp May 9, 2024
ed1cd6c
Merge pull request #73527 from apple/enable-windows-arm64
shahmishal May 9, 2024
b2bd176
[Concurrency] Fix too eager early return in checkIsolation mode detec…
ktoso May 9, 2024
396b055
Implement Builtin.freeze for integer and integer-vector types. (#73519)
stephentyrone May 9, 2024
d84cbac
[cxx-interop] Fix test for reference types on armv7k
egorzhdan May 9, 2024
27829b7
[cxx-interop] Fix execution test for reference types
egorzhdan May 9, 2024
38371cd
Merge pull request #73508 from apple/egorzhdan/witness-table-test
egorzhdan May 9, 2024
387e8d3
Merge pull request #73516 from nate-chandler/rdar127755503
nate-chandler May 9, 2024
5b5ffde
[cxx-interop] Do not crash when passing `Bool` as `const T&` parameter
egorzhdan May 8, 2024
b2bc7a0
Merge pull request #73518 from z2oh/z2oh/fix-windows-search-path-options
compnerd May 9, 2024
2d61e3d
Merge pull request #73531 from jckarter/forwarding-force-unwrap
jckarter May 9, 2024
30a5986
[lld] Allow opt-out from building lld via --skip-build-lld
kubamracek May 9, 2024
921c0e5
Simplify lld selection logic in build_script_invocation.py
kubamracek May 9, 2024
b7bc872
Add nullptr check in maybeExtractNearestSourceLoc
augusto2112 May 8, 2024
c77593a
Merge pull request #73536 from apple/egorzhdan/frt-tests
egorzhdan May 9, 2024
0971654
Merge pull request #73513 from apple/egorzhdan/const-ref-bool-crash
egorzhdan May 9, 2024
b5383ab
NFC: use clear terminology
kavon May 9, 2024
e7e2ad1
Ensure we are using mapped SIL type for switch_enum case and not the …
asl May 9, 2024
db54207
AST: Introduce TypeBase::hasPrimaryArchetype()
slavapestov May 9, 2024
b421b1a
Merge pull request #73544 from kavon/kavon/fix-comment-5-9-2024
kavon May 9, 2024
cb03a45
Make SwiftValue == support unconditional
tbkka May 9, 2024
ab5425f
Update test expectations around --skip-build-lld
kubamracek May 9, 2024
0a0e665
[Macros] Ensure reaping executable plugin process
rintaro May 9, 2024
2f361ae
XFAIL typeref_decoding.swift (#73537)
ktoso May 10, 2024
db1c721
Merge pull request #73499 from augusto2112/nullptr-source-lock
augusto2112 May 10, 2024
bd9f9ea
[Gardening] SIL: Verifier messages use "lifetime".
nate-chandler May 10, 2024
28d7b20
Merge pull request #73547 from rintaro/macros-plugin-waitpid-rdar1264…
rintaro May 10, 2024
340bfcd
Merge pull request #73534 from hyp/eng/fix-readlink
hyp May 10, 2024
c09fa4e
Merge pull request #73539 from kubamracek/lld-opt-out
kubamracek May 10, 2024
1b848ac
Merge pull request #73560 from nate-chandler/gardening/20240509/1
nate-chandler May 10, 2024
7b00f17
Deserializer: flush the diag engine to see a function type mismatch e…
eeckstein May 10, 2024
34a57ce
Merge pull request #73565 from eeckstein/fix-error-message
eeckstein May 10, 2024
796ae1d
Merge pull request #73510 from apple/egorzhdan/macro-name-collision
egorzhdan May 10, 2024
e74cfb0
Merge pull request #73386 from nate-chandler/lifetime-completion/2024…
nate-chandler May 10, 2024
01654fd
Merge pull request #71775 from jkshtj/main
jkshtj May 10, 2024
829f442
Merge pull request #70441 from kubamracek/embedded-diagnose-alloc-ref…
kubamracek May 10, 2024
c1031b4
[Test] Temporarily mark typeref_decoding.swift as unsupported
bnbarham May 10, 2024
8c0726d
Merge pull request #73571 from bnbarham/flakey-test-unsupported
shahmishal May 10, 2024
90341b2
Infer protocol isolation from its inherited protocols.
DougGregor May 10, 2024
03ea6a1
Merge pull request #73491 from tbkka/tbkka-mpe-sparebits
tbkka May 10, 2024
7bdffbb
[embedded] Mark test/embedded/lto-multiple-object-files.swift as REQU…
kubamracek May 10, 2024
839e8ec
SIL: Add missing SILType::has*Archetype() predicates
slavapestov May 10, 2024
4597cc3
AST: Change condition to assert in TypeAliasDecl::setUnderlyingType()
slavapestov May 10, 2024
8d30645
AST: Use hasPrimaryArchetype() in a few places
slavapestov May 9, 2024
6a4f7ff
AST: Allow local archetypes in interface types of local declarations
slavapestov May 10, 2024
305e796
AST: Rewrite GenericEnvironment::mapElementTypeIntoPackContext()
slavapestov May 10, 2024
7e36060
AST: Remove VarDecl::getOpenedElementEnvironment()
slavapestov May 10, 2024
da8a087
Update tests to match new expectations everywhere
tbkka May 11, 2024
6df0de5
Merge pull request #73570 from slavapestov/pack-expansion-closures-pa…
slavapestov May 11, 2024
a8a0dd8
Merge pull request #73573 from kubamracek/embedded-lto-test
kubamracek May 11, 2024
4cd5f6a
Merge pull request #73572 from DougGregor/infer-isolation-from-inheri…
DougGregor May 11, 2024
54a2007
Merge pull request #73552 from tbkka/tbkka-127839540
tbkka May 11, 2024
8578a0e
Add some additional test coverage for duration static methods (#73578)
stephentyrone May 11, 2024
f545ffe
[android] add a module map for Android NDK
hyp Mar 27, 2024
1faaa1c
[android] add an android NDK Swift overlay module, and use it instead…
hyp Mar 27, 2024
2fa7bbf
android test fixes
hyp May 4, 2024
3c2911e
add one more concurrency test fix
hyp May 9, 2024
b829982
update tests to use canImport(android) and make libc test for general…
hyp May 9, 2024
7b41406
[android] Update tests to use new Android overlay and disable stdlib/…
finagolfin May 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ swift_compiler_sources(Optimizer
AsyncDemotion.swift
BooleanLiteralFolding.swift
CleanupDebugSteps.swift
ClosureSpecialization.swift
ComputeEscapeEffects.swift
ComputeSideEffects.swift
DeadStoreElimination.swift
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ private func registerSwiftPasses() {
registerPass(lifetimeDependenceDiagnosticsPass, { lifetimeDependenceDiagnosticsPass.run($0) })
registerPass(lifetimeDependenceInsertionPass, { lifetimeDependenceInsertionPass.run($0) })
registerPass(lifetimeDependenceScopeFixupPass, { lifetimeDependenceScopeFixupPass.run($0) })
registerPass(generalClosureSpecialization, { generalClosureSpecialization.run($0) })
registerPass(autodiffClosureSpecialization, { autodiffClosureSpecialization.run($0) })

// Instruction passes
registerForSILCombine(BeginCOWMutationInst.self, { run(BeginCOWMutationInst.self, $0) })
registerForSILCombine(GlobalValueInst.self, { run(GlobalValueInst.self, $0) })
Expand Down
21 changes: 21 additions & 0 deletions SwiftCompilerSources/Sources/Optimizer/Utilities/OptUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,23 @@ extension LoadInst {
}
}

extension PartialApplyInst {
var isPartialApplyOfReabstractionThunk: Bool {
// A partial_apply of a reabstraction thunk either has a single capture
// (a function) or two captures (function and dynamic Self type).
if self.numArguments == 1 || self.numArguments == 2,
let fun = self.referencedFunction,
fun.isReabstractionThunk,
self.arguments[0].type.isFunction,
self.arguments[0].type.isReferenceCounted(in: self.parentFunction) || self.callee.type.isThickFunction
{
return true
}

return false
}
}

extension FunctionPassContext {
/// Returns true if any blocks were removed.
func removeDeadBlocks(in function: Function) -> Bool {
Expand Down Expand Up @@ -540,6 +557,10 @@ extension Function {
}
return nil
}

var mayBindDynamicSelf: Bool {
self.bridged.mayBindDynamicSelf()
}
}

extension FullApplySite {
Expand Down
3 changes: 2 additions & 1 deletion SwiftCompilerSources/Sources/Optimizer/Utilities/Test.swift
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ public func registerOptimizerTests() {
lifetimeDependenceUseTest,
linearLivenessTest,
parseTestSpecificationTest,
variableIntroducerTest
variableIntroducerTest,
gatherCallSitesTest
)

// Finally register the thunk they all call through.
Expand Down
14 changes: 13 additions & 1 deletion SwiftCompilerSources/Sources/SIL/ApplySite.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ public protocol ApplySite : Instruction {
extension ApplySite {
public var callee: Value { operands[ApplyOperandConventions.calleeIndex].value }

public var hasSubstitutions: Bool {
return substitutionMap.hasAnySubstitutableParams
}

public var isAsync: Bool {
return callee.type.isAsyncFunction
}
Expand All @@ -126,7 +130,15 @@ extension ApplySite {
return false
}

/// Returns the subset of operands that are argument operands.
public var isCalleeNoReturn: Bool {
bridged.ApplySite_isCalleeNoReturn()
}

public var isCalleeTrapNoReturn: Bool {
referencedFunction?.isTrapNoReturn ?? false
}

/// Returns the subset of operands which are argument operands.
///
/// This does not include the callee function operand.
public var argumentOperands: OperandArray {
Expand Down
20 changes: 20 additions & 0 deletions SwiftCompilerSources/Sources/SIL/BasicBlock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,26 @@ final public class BasicBlock : CustomStringConvertible, HasShortDescription, Ha
successors.count == 1 ? successors[0] : nil
}

/// All function exiting blocks except for ones with an `unreachable` terminator,
/// not immediately preceded by an apply of a no-return function.
public var isReachableExitBlock: Bool {
switch terminator {
case let termInst where termInst.isFunctionExiting:
return true
case is UnreachableInst:
if let instBeforeUnreachable = terminator.previous,
let ai = instBeforeUnreachable as? ApplyInst,
ai.isCalleeNoReturn && !ai.isCalleeTrapNoReturn
{
return true
}

return false
default:
return false
}
}

/// The index of the basic block in its function.
/// This has O(n) complexity. Only use it for debugging
public var index: Int {
Expand Down
12 changes: 12 additions & 0 deletions SwiftCompilerSources/Sources/SIL/Function.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ final public class Function : CustomStringConvertible, HasShortDescription, Hash
hasher.combine(ObjectIdentifier(self))
}

public var isTrapNoReturn: Bool { bridged.isTrapNoReturn() }

public var isAutodiffVJP: Bool { bridged.isAutodiffVJP() }

public var specializationLevel: Int { bridged.specializationLevel() }

public var hasOwnership: Bool { bridged.hasOwnership() }

public var hasLoweredAddresses: Bool { bridged.hasLoweredAddresses() }
Expand Down Expand Up @@ -59,6 +65,10 @@ final public class Function : CustomStringConvertible, HasShortDescription, Hash
entryBlock.arguments.lazy.map { $0 as! FunctionArgument }
}

public func argument(at index: Int) -> FunctionArgument {
entryBlock.arguments[index] as! FunctionArgument
}

/// All instructions of all blocks.
public var instructions: LazySequence<FlattenSequence<LazyMapSequence<BasicBlockList, InstructionList>>> {
blocks.lazy.flatMap { $0.instructions }
Expand All @@ -83,6 +93,8 @@ final public class Function : CustomStringConvertible, HasShortDescription, Hash

public var isAsync: Bool { bridged.isAsync() }

public var isReabstractionThunk: Bool { bridged.isReabstractionThunk() }

/// True if this is a `[global_init]` function.
///
/// Such a function is typically a global addressor which calls the global's
Expand Down
11 changes: 10 additions & 1 deletion SwiftCompilerSources/Sources/SIL/Instruction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,16 @@ class ConvertFunctionInst : SingleValueInstruction, UnaryInstruction {
}

final public
class ThinToThickFunctionInst : SingleValueInstruction, UnaryInstruction {}
class ThinToThickFunctionInst : SingleValueInstruction, UnaryInstruction {
public var callee: Value { operand.value }

public var referencedFunction: Function? {
if let fri = callee as? FunctionRefInst {
return fri.referencedFunction
}
return nil
}
}

final public class ThickToObjCMetatypeInst : SingleValueInstruction {}
final public class ObjCToThickMetatypeInst : SingleValueInstruction {}
Expand Down
2 changes: 2 additions & 0 deletions SwiftCompilerSources/Sources/SIL/SubstitutionMap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public struct SubstitutionMap {

public var isEmpty: Bool { bridged.isEmpty() }

public var hasAnySubstitutableParams: Bool { bridged.hasAnySubstitutableParams() }

public var replacementTypes: OptionalTypeArray {
let types = BridgedTypeArray.fromReplacementTypes(bridged)
return OptionalTypeArray(bridged: types)
Expand Down
1 change: 1 addition & 0 deletions SwiftCompilerSources/Sources/SIL/Type.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public struct Type : CustomStringConvertible, NoReflectionChildren {
public var isMetatype: Bool { bridged.isMetatype() }
public var isNoEscapeFunction: Bool { bridged.isNoEscapeFunction() }
public var containsNoEscapeFunction: Bool { bridged.containsNoEscapeFunction() }
public var isThickFunction: Bool { bridged.isThickFunction() }
public var isAsyncFunction: Bool { bridged.isAsyncFunction() }

public var canBeClass: BridgedType.TraitResult { bridged.canBeClass() }
Expand Down
2 changes: 2 additions & 0 deletions include/swift/AST/Builtins.def
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ BUILTIN_UNARY_OPERATION(FNeg, "fneg", "n", FloatOrVector)
BUILTIN_UNARY_OPERATION(AssumeNonNegative, "assumeNonNegative", "n", Integer)
// It only works on i1.
BUILTIN_UNARY_OPERATION(AssumeTrue, "assume", "", Integer)
// Converts poison/undef to an indeterminate but valid value.
BUILTIN_UNARY_OPERATION(Freeze, "freeze", "n", IntegerOrVector)

// Binary predicates have type (T,T) -> i1 or (T, T) -> Vector<i1> for scalars
// and vectors, respectively.
Expand Down
11 changes: 0 additions & 11 deletions include/swift/AST/Decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -6010,10 +6010,6 @@ enum class PropertyWrapperSynthesizedPropertyKind {
class VarDecl : public AbstractStorageDecl {
friend class NamingPatternRequest;
NamedPattern *NamingPattern = nullptr;
/// When the variable is declared in context of a for-in loop over the elements of
/// a parameter pack, this is the opened element environment of the pack expansion
/// to use as the variable's context generic environment.
GenericEnvironment *OpenedElementEnvironment = nullptr;

public:
enum class Introducer : uint8_t {
Expand Down Expand Up @@ -6155,13 +6151,6 @@ class VarDecl : public AbstractStorageDecl {
NamedPattern *getNamingPattern() const;
void setNamingPattern(NamedPattern *Pat);

GenericEnvironment *getOpenedElementEnvironment() const {
return OpenedElementEnvironment;
}
void setOpenedElementEnvironment(GenericEnvironment *Env) {
OpenedElementEnvironment = Env;
}

/// If this is a VarDecl that does not belong to a CaseLabelItem's pattern,
/// return this. Otherwise, this VarDecl must belong to a CaseStmt's
/// CaseLabelItem. In that case, return the first case label item of the first
Expand Down
2 changes: 2 additions & 0 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -2044,6 +2044,8 @@ ERROR(expose_move_only_to_cxx,none,
"noncopyable %kind0 can not yet be represented in C++", (ValueDecl *))
ERROR(expose_nested_type_to_cxx,none,
"nested %kind0 can not yet be represented in C++", (ValueDecl *))
ERROR(expose_macro_to_cxx,none,
"Swift macro can not yet be represented in C++", (ValueDecl *))
ERROR(unexposed_other_decl_in_cxx,none,
"%kind0 is not yet exposed to C++", (ValueDecl *))
ERROR(unsupported_other_decl_in_cxx,none,
Expand Down
3 changes: 3 additions & 0 deletions include/swift/AST/PrintOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@ struct PrintOptions {
/// Suppress printing of '~Proto' for suppressible, non-invertible protocols.
bool SuppressConformanceSuppression = false;

/// Replace BitwiseCopyable with _BitwiseCopyable.
bool SuppressBitwiseCopyable = false;

/// List of attribute kinds that should not be printed.
std::vector<AnyAttrKind> ExcludeAttrList = {
DeclAttrKind::Transparent, DeclAttrKind::Effects,
Expand Down
4 changes: 4 additions & 0 deletions include/swift/AST/SILOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@ class SILOptions {
/// Are we building in embedded Swift + -no-allocations?
bool NoAllocations = false;

/// Should we use the experimental Swift based closure-specialization
/// optimization pass instead of the existing C++ one.
bool EnableExperimentalSwiftBasedClosureSpecialization = false;

/// The name of the file to which the backend should save optimization
/// records.
std::string OptRecordFile;
Expand Down
8 changes: 4 additions & 4 deletions include/swift/AST/SearchPathOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,10 @@ class SearchPathOptions {
FrameworkSearchPaths.size() - 1);
}

std::optional<StringRef> WinSDKRoot = std::nullopt;
std::optional<StringRef> WinSDKVersion = std::nullopt;
std::optional<StringRef> VCToolsRoot = std::nullopt;
std::optional<StringRef> VCToolsVersion = std::nullopt;
std::optional<std::string> WinSDKRoot = std::nullopt;
std::optional<std::string> WinSDKVersion = std::nullopt;
std::optional<std::string> VCToolsRoot = std::nullopt;
std::optional<std::string> VCToolsVersion = std::nullopt;

public:
StringRef getSDKPath() const { return SDKPath; }
Expand Down
5 changes: 5 additions & 0 deletions include/swift/AST/SimpleRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ template<typename T,
typename = typename std::enable_if<
canExtractNearestSourceLoc<T>()>::type>
SourceLoc maybeExtractNearestSourceLoc(const T& value) {
if constexpr (std::is_pointer_v<T>) {
if (value == nullptr) {
return SourceLoc();
}
}
return extractNearestSourceLoc(value);
}

Expand Down
1 change: 1 addition & 0 deletions include/swift/AST/SwiftNameTranslation.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ enum RepresentationError {
UnrepresentableProtocol,
UnrepresentableMoveOnly,
UnrepresentableNested,
UnrepresentableMacro,
};

/// Constructs a diagnostic that describes the given C++ representation error.
Expand Down
36 changes: 21 additions & 15 deletions include/swift/AST/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,9 @@ class RecursiveTypeProperties {
/// This type expression contains a TypeVariableType.
HasTypeVariable = 0x01,

/// This type expression contains a context-dependent archetype, either a
/// \c PrimaryArchetypeType, \c OpenedArchetypeType,
/// \c ElementArchetypeType, or \c PackArchetype.
HasArchetype = 0x02,
/// This type expression contains a PrimaryArchetypeType
/// or PackArchetypeType.
HasPrimaryArchetype = 0x02,

/// This type expression contains a GenericTypeParamType.
HasTypeParameter = 0x04,
Expand Down Expand Up @@ -171,7 +170,7 @@ class RecursiveTypeProperties {
/// This type contains a parameterized existential type \c any P<T>.
HasParameterizedExistential = 0x2000,

/// This type contains an ElementArchetype.
/// This type contains an ElementArchetypeType.
HasElementArchetype = 0x4000,

/// Whether the type is allocated in the constraint solver arena. This can
Expand Down Expand Up @@ -205,9 +204,9 @@ class RecursiveTypeProperties {
/// variable?
bool hasTypeVariable() const { return Bits & HasTypeVariable; }

/// Does a type with these properties structurally contain a
/// context-dependent archetype (that is, a Primary- or OpenedArchetype)?
bool hasArchetype() const { return Bits & HasArchetype; }
/// Does a type with these properties structurally contain a primary
/// archetype?
bool hasPrimaryArchetype() const { return Bits & HasPrimaryArchetype; }

/// Does a type with these properties structurally contain an
/// archetype from an opaque type declaration?
Expand Down Expand Up @@ -696,9 +695,21 @@ class alignas(1 << TypeAlignInBits) TypeBase
return getRecursiveProperties().hasPlaceholder();
}

/// Determine whether the type involves a context-dependent archetype.
/// Determine whether the type involves a primary archetype.
bool hasPrimaryArchetype() const {
return getRecursiveProperties().hasPrimaryArchetype();
}

/// Whether the type contains a PackArchetypeType.
bool hasPackArchetype() const {
return getRecursiveProperties().hasPackArchetype();
}

/// Determine whether the type involves a primary, pack or local archetype.
///
/// FIXME: Replace all remaining callers with a more precise check.
bool hasArchetype() const {
return getRecursiveProperties().hasArchetype();
return hasPrimaryArchetype() || hasLocalArchetype();
}

/// Determine whether the type involves an opened existential archetype.
Expand Down Expand Up @@ -727,11 +738,6 @@ class alignas(1 << TypeAlignInBits) TypeBase
return getRecursiveProperties().hasPack();
}

/// Whether the type contains a PackArchetypeType.
bool hasPackArchetype() const {
return getRecursiveProperties().hasPackArchetype();
}

/// Whether the type has any flavor of pack.
bool hasAnyPack() const {
return hasParameterPack() || hasPack() || hasPackArchetype();
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Basic/Features.def
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ LANGUAGE_FEATURE(BuiltinCreateTask, 0, "Builtin.createTask and Builtin.createDis
SUPPRESSIBLE_LANGUAGE_FEATURE(AssociatedTypeImplements, 0, "@_implements on associated types")
LANGUAGE_FEATURE(BuiltinAddressOfRawLayout, 0, "Builtin.addressOfRawLayout")
LANGUAGE_FEATURE(MoveOnlyPartialConsumption, 429, "Partial consumption of noncopyable values")
/// Enable bitwise-copyable feature.
LANGUAGE_FEATURE(BitwiseCopyable, 426, "BitwiseCopyable protocol")
SUPPRESSIBLE_LANGUAGE_FEATURE(ConformanceSuppression, 426, "Suppressible inferred conformances")
SUPPRESSIBLE_LANGUAGE_FEATURE(BitwiseCopyable2, 426, "BitwiseCopyable feature")
SUPPRESSIBLE_LANGUAGE_FEATURE(NoncopyableGenerics, 427, "Noncopyable generics")

// Swift 6
Expand Down
4 changes: 4 additions & 0 deletions include/swift/Option/FrontendOptions.td
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@ def enable_experimental_async_top_level :
// HIDDEN FLAGS
let Flags = [FrontendOption, NoDriverOption, HelpHidden] in {

def enable_experimental_swift_based_closure_specialization :
Flag<["-"], "experimental-swift-based-closure-specialization">,
HelpText<"Use the experimental Swift based closure-specialization optimization pass instead of the existing C++ one">;

def checked_async_objc_bridging : Joined<["-"], "checked-async-objc-bridging=">,
HelpText<"Control whether checked continuations are used when bridging "
"async calls from Swift to ObjC: 'on', 'off' ">;
Expand Down
Loading