Skip to content

formatting followup #64886

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

Merged
merged 1 commit into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions include/swift/AST/ASTContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -891,8 +891,10 @@ class ASTContext final {
/// Get the back-deployed availability for concurrency.
AvailabilityContext getBackDeployedConcurrencyAvailability();

/// The the availability since when distributed actors are able to have custom executors.
AvailabilityContext getConcurrencyDistributedActorWithCustomExecutorAvailability();
/// The the availability since when distributed actors are able to have custom
/// executors.
AvailabilityContext
getConcurrencyDistributedActorWithCustomExecutorAvailability();

/// Get the runtime availability of support for differentiation.
AvailabilityContext getDifferentiationAvailability();
Expand Down
21 changes: 9 additions & 12 deletions include/swift/AST/Availability.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ class VersionRange {
// x.y.x: all versions greater than or equal to x.y.z

enum class ExtremalRange { Empty, All };

// A version range is either an extremal value (Empty, All) or
// a single version tuple value representing the lower end point x.y.z of a
// range [x.y.z, +Inf).
union {
llvm::VersionTuple LowerEndpoint;
ExtremalRange ExtremalValue;
};

unsigned HasLowerEndpoint : 1;

public:
Expand Down Expand Up @@ -86,7 +86,7 @@ class VersionRange {
bool isContainedIn(const VersionRange &Other) const {
if (isEmpty() || Other.isAll())
return true;

if (isAll() || Other.isEmpty())
return false;

Expand Down Expand Up @@ -326,17 +326,15 @@ class AvailabilityContext {
OSVersion.unionWith(other.getOSVersion());
}

bool isAvailableAsSPI() const {
return SPI && *SPI;
}
bool isAvailableAsSPI() const { return SPI && *SPI; }

/// Returns a representation of this range as a string for debugging purposes.
std::string getAsString() const {
return "AvailabilityContext(" + OSVersion.getAsString() + (isAvailableAsSPI() ? ", spi" : "") + ")";
return "AvailabilityContext(" + OSVersion.getAsString() +
(isAvailableAsSPI() ? ", spi" : "") + ")";
}
};


class AvailabilityInference {
public:
/// Returns the decl that should be considered the parent decl of the given
Expand All @@ -348,8 +346,8 @@ class AvailabilityInference {
/// to ToDecl.
static void
applyInferredAvailableAttrs(Decl *ToDecl,
ArrayRef<const Decl *> InferredFromDecls,
ASTContext &Context);
ArrayRef<const Decl *> InferredFromDecls,
ASTContext &Context);

static AvailabilityContext inferForType(Type t);

Expand All @@ -376,8 +374,7 @@ class AvailabilityInference {
ASTContext &C);

static AvailabilityContext
annotatedAvailableRangeForAttr(const SpecializeAttr* attr, ASTContext &ctx);

annotatedAvailableRangeForAttr(const SpecializeAttr *attr, ASTContext &ctx);
};

} // end namespace swift
Expand Down