Skip to content

Commit 7b73530

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 2590699 commit 7b73530

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

clang/include/clang/AST/ASTContext.h

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

805805
struct AvailabilityDomainInfo {
806806
FeatureAvailKind Kind = FeatureAvailKind::None;
807+
Decl *Decl = nullptr;
807808
ImplicitCastExpr *Call = nullptr;
808809
bool isInvalid() const { return Kind == FeatureAvailKind::None; }
809810
};

clang/lib/AST/ASTContext.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ ASTContext::getFeatureAvailInfo(Decl *D) const {
950950
llvm_unreachable("invalid feature kind");
951951
}
952952

953-
ASTContext::AvailabilityDomainInfo Info{Kind, nullptr};
953+
ASTContext::AvailabilityDomainInfo Info{Kind, D, nullptr};
954954

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

0 commit comments

Comments
 (0)