|
25 | 25 | namespace swift {
|
26 | 26 | class ASTContext;
|
27 | 27 | class AvailableAttr;
|
| 28 | +class BackDeployedAttr; |
28 | 29 | class Decl;
|
29 | 30 |
|
30 | 31 | /// A lattice of version ranges of the form [x.y.z, +Inf).
|
@@ -380,6 +381,39 @@ class AvailabilityInference {
|
380 | 381 |
|
381 | 382 | static AvailabilityContext
|
382 | 383 | annotatedAvailableRangeForAttr(const SpecializeAttr *attr, ASTContext &ctx);
|
| 384 | + |
| 385 | + /// For the attribute's introduction version, update the platform and version |
| 386 | + /// values to the re-mapped platform's, if using a fallback platform. |
| 387 | + /// Returns `true` if a remap occured. |
| 388 | + static bool updateIntroducedPlatformForFallback( |
| 389 | + const AvailableAttr *attr, const ASTContext &Ctx, |
| 390 | + llvm::StringRef &Platform, llvm::VersionTuple &PlatformVer); |
| 391 | + |
| 392 | + /// For the attribute's deprecation version, update the platform and version |
| 393 | + /// values to the re-mapped platform's, if using a fallback platform. |
| 394 | + /// Returns `true` if a remap occured. |
| 395 | + static bool updateDeprecatedPlatformForFallback( |
| 396 | + const AvailableAttr *attr, const ASTContext &Ctx, |
| 397 | + llvm::StringRef &Platform, llvm::VersionTuple &PlatformVer); |
| 398 | + |
| 399 | + /// For the attribute's obsoletion version, update the platform and version |
| 400 | + /// values to the re-mapped platform's, if using a fallback platform. |
| 401 | + /// Returns `true` if a remap occured. |
| 402 | + static bool updateObsoletedPlatformForFallback( |
| 403 | + const AvailableAttr *attr, const ASTContext &Ctx, |
| 404 | + llvm::StringRef &Platform, llvm::VersionTuple &PlatformVer); |
| 405 | + |
| 406 | + static void updatePlatformStringForFallback( |
| 407 | + const AvailableAttr *attr, const ASTContext &Ctx, |
| 408 | + llvm::StringRef &Platform); |
| 409 | + |
| 410 | + /// For the attribute's before version, update the platform and version |
| 411 | + /// values to the re-mapped platform's, if using a fallback platform. |
| 412 | + /// Returns `true` if a remap occured. |
| 413 | + static bool updateBeforePlatformForFallback(const BackDeployedAttr *attr, |
| 414 | + const ASTContext &Ctx, |
| 415 | + llvm::StringRef &Platform, |
| 416 | + llvm::VersionTuple &PlatformVer); |
383 | 417 | };
|
384 | 418 |
|
385 | 419 | /// Given a declaration upon which an availability attribute would appear in
|
|
0 commit comments