Skip to content

Commit 08d3e4c

Browse files
committed
Store the backing decl on AvailabilityDomainInfo.
Swift needs to be able to look up the `VarDecl` that defines a given feature availability domain.
1 parent 1a09f8f commit 08d3e4c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Diff for: clang/include/clang/AST/ASTContext.h

+1
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,7 @@ class ASTContext : public RefCountedBase<ASTContext> {
825825

826826
struct AvailabilityDomainInfo {
827827
FeatureAvailKind Kind = FeatureAvailKind::None;
828+
Decl *Decl = nullptr;
828829
ImplicitCastExpr *Call = nullptr;
829830
bool isInvalid() const { return Kind == FeatureAvailKind::None; }
830831
};

Diff for: clang/lib/AST/ASTContext.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ ASTContext::getFeatureAvailInfo(Decl *D) const {
980980
llvm_unreachable("invalid feature kind");
981981
}
982982

983-
ASTContext::AvailabilityDomainInfo Info{Kind, nullptr};
983+
ASTContext::AvailabilityDomainInfo Info{Kind, D, nullptr};
984984

985985
if (Kind == FeatureAvailKind::Dynamic) {
986986
Expr *FnExpr = Init->getInit(1);

0 commit comments

Comments
 (0)