Merge pull request #67761 from tshortli/ast-unavailable-decl-queries

NFC: Hoist queries for unavailable decl optimizations into the AST library
This commit is contained in:
Allan Shortlidge
2023-08-06 10:01:27 -07:00
committed by GitHub
18 changed files with 71 additions and 68 deletions

View File

@@ -1234,6 +1234,18 @@ public:
llvm::Optional<std::pair<const AvailableAttr *, const Decl *>>
getSemanticUnavailableAttr() const;
/// Returns true if this declaration should be considered available during
/// SIL/IR lowering. A declaration would not be available during lowering if,
/// for example, it is annotated as unavailable with \c @available and
/// optimization settings require that it be omitted.
bool isAvailableDuringLowering() const;
/// Returns true if ABI compatibility stubs must be emitted for the given
/// declaration. Decls marked unavailable with \c @available require these
/// stubs if the compiler flags have enabled unavailable declaration ABI
/// compatibility mode.
bool requiresUnavailableDeclABICompatibilityStubs() const;
// List the SPI groups declared with @_spi or inherited by this decl.
//
// SPI groups are inherited from the parent contexts only if the local decl