Skip to content

Commit 9239a40

Browse files
committed
Add VarDecl::getPointerAuthQualifier api
1 parent a515e0d commit 9239a40

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

include/swift/AST/Decl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5939,6 +5939,8 @@ class VarDecl : public AbstractStorageDecl {
59395939
});
59405940
}
59415941

5942+
clang::PointerAuthQualifier getPointerAuthQualifier() const;
5943+
59425944
// Implement isa/cast/dyncast/etc.
59435945
static bool classof(const Decl *D) {
59445946
return D->getKind() == DeclKind::Var || D->getKind() == DeclKind::Param;

lib/AST/TypeWrapper.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,12 @@ bool VarDecl::isTypeWrapperLocalStorageForInitializer() const {
4444
}
4545
return false;
4646
}
47+
48+
clang::PointerAuthQualifier VarDecl::getPointerAuthQualifier() const {
49+
if (auto *clangDecl = getClangDecl()) {
50+
if (auto *valueDecl = dyn_cast<clang::ValueDecl>(clangDecl)) {
51+
return valueDecl->getType().getPointerAuth();
52+
}
53+
}
54+
return clang::PointerAuthQualifier();
55+
}

0 commit comments

Comments
 (0)