Skip to content

Commit cbfde21

Browse files
committed
[clang] Support PointerAuthQualifier in QualType
1 parent 71d7760 commit cbfde21

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

clang/include/clang/AST/ASTContext.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2182,6 +2182,16 @@ class ASTContext : public RefCountedBase<ASTContext> {
21822182
return getQualifiedType(type.getUnqualifiedType(), Qs);
21832183
}
21842184

2185+
/// \brief Return a type with the given __ptrauth qualifier.
2186+
QualType getPointerAuthType(QualType type, PointerAuthQualifier pointerAuth) {
2187+
assert(!type.getPointerAuth());
2188+
assert(pointerAuth);
2189+
2190+
Qualifiers qs;
2191+
qs.setPointerAuth(pointerAuth);
2192+
return getQualifiedType(type, qs);
2193+
}
2194+
21852195
unsigned char getFixedPointScale(QualType Ty) const;
21862196
unsigned char getFixedPointIBits(QualType Ty) const;
21872197
llvm::FixedPointSemantics getFixedPointSemantics(QualType Ty) const;

clang/include/clang/AST/Type.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,6 +1434,10 @@ class QualType {
14341434
// true when Type is objc's weak and weak is enabled but ARC isn't.
14351435
bool isNonWeakInMRRWithObjCWeak(const ASTContext &Context) const;
14361436

1437+
PointerAuthQualifier getPointerAuth() const {
1438+
return getQualifiers().getPointerAuth();
1439+
}
1440+
14371441
enum PrimitiveDefaultInitializeKind {
14381442
/// The type does not fall into any of the following categories. Note that
14391443
/// this case is zero-valued so that values of this enum can be used as a

0 commit comments

Comments
 (0)