summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Hunt <oliver@apple.com>2025-08-26 15:52:37 -0700
committerOliver Hunt <oliver@apple.com>2025-08-26 15:52:37 -0700
commit551f7b2c9e0560ac1f5d37e83ec0e9f7b3d536ef (patch)
tree07157d3ebda8681adc721e0792adabeecd51621a
parent161328cb97035946a6aa1747600cba488227c57a (diff)
Remove ABI changesusers/ojhunt/pr/155492
-rw-r--r--clang/include/clang/AST/ASTContext.h8
-rw-r--r--clang/lib/AST/ASTContext.cpp7
-rw-r--r--clang/lib/AST/Type.cpp8
-rw-r--r--clang/lib/Sema/SemaTypeTraits.cpp2
4 files changed, 12 insertions, 13 deletions
diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h
index c0e702dba8d5..993eca8c4738 100644
--- a/clang/include/clang/AST/ASTContext.h
+++ b/clang/include/clang/AST/ASTContext.h
@@ -634,7 +634,7 @@ public:
/// contain data that is address discriminated. This includes
/// implicitly authenticated values like vtable pointers, as well as
/// explicitly qualified fields.
- bool containsAddressDiscriminatedPointerAuth(QualType T) const {
+ bool containsAddressDiscriminatedPointerAuth(QualType T) {
if (!isPointerAuthenticationAvailable())
return false;
return findPointerAuthContent(T) != PointerAuthContent::None;
@@ -666,8 +666,8 @@ private:
bool isPointerAuthenticationAvailable() const {
return LangOpts.PointerAuthCalls || LangOpts.PointerAuthIntrinsics;
}
- PointerAuthContent findPointerAuthContent(QualType T) const;
- mutable llvm::DenseMap<const RecordDecl *, PointerAuthContent>
+ PointerAuthContent findPointerAuthContent(QualType T);
+ llvm::DenseMap<const RecordDecl *, PointerAuthContent>
RecordContainsAddressDiscriminatedPointerAuth;
ImportDecl *FirstLocalImport = nullptr;
@@ -3697,7 +3697,7 @@ public:
/// Resolve the root record to be used to derive the vtable pointer
/// authentication policy for the specified record.
const CXXRecordDecl *
- baseForVTableAuthentication(const CXXRecordDecl *ThisClass) const;
+ baseForVTableAuthentication(const CXXRecordDecl *ThisClass);
bool useAbbreviatedThunkName(GlobalDecl VirtualMethodDecl,
StringRef MangledName);
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 61455ac48287..92d1b536e474 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -1706,7 +1706,7 @@ void ASTContext::setRelocationInfoForCXXRecord(
}
static bool primaryBaseHaseAddressDiscriminatedVTableAuthentication(
- const ASTContext &Context, const CXXRecordDecl *Class) {
+ ASTContext &Context, const CXXRecordDecl *Class) {
if (!Class->isPolymorphic())
return false;
const CXXRecordDecl *BaseType = Context.baseForVTableAuthentication(Class);
@@ -1721,8 +1721,7 @@ static bool primaryBaseHaseAddressDiscriminatedVTableAuthentication(
return AddressDiscrimination == AuthAttr::AddressDiscrimination;
}
-ASTContext::PointerAuthContent
-ASTContext::findPointerAuthContent(QualType T) const {
+ASTContext::PointerAuthContent ASTContext::findPointerAuthContent(QualType T) {
assert(isPointerAuthenticationAvailable());
T = T.getCanonicalType();
@@ -15107,7 +15106,7 @@ StringRef ASTContext::getCUIDHash() const {
}
const CXXRecordDecl *
-ASTContext::baseForVTableAuthentication(const CXXRecordDecl *ThisClass) const {
+ASTContext::baseForVTableAuthentication(const CXXRecordDecl *ThisClass) {
assert(ThisClass);
assert(ThisClass->isPolymorphic());
const CXXRecordDecl *PrimaryBase = ThisClass;
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index 65024fcb1b7c..bd3dd983bca7 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -2717,7 +2717,7 @@ bool QualType::isCXX98PODType(const ASTContext &Context) const {
QualType CanonicalType = getTypePtr()->CanonicalType;
// Any type that is, or contains, address discriminated data is never POD.
- if (Context.containsAddressDiscriminatedPointerAuth(CanonicalType))
+ if (const_cast<ASTContext&>(Context).containsAddressDiscriminatedPointerAuth(CanonicalType))
return false;
switch (CanonicalType->getTypeClass()) {
@@ -2780,7 +2780,7 @@ bool QualType::isTrivialType(const ASTContext &Context) const {
// Any type that is, or contains, address discriminated data is never a
// trivial type.
- if (Context.containsAddressDiscriminatedPointerAuth(CanonicalType))
+ if (const_cast<ASTContext&>(Context).containsAddressDiscriminatedPointerAuth(CanonicalType))
return false;
// C++0x [basic.types]p9:
@@ -2883,7 +2883,7 @@ bool QualType::isBitwiseCloneableType(const ASTContext &Context) const {
// Any type that is, or contains, address discriminated data is never
// bitwise clonable.
- if (Context.containsAddressDiscriminatedPointerAuth(CanonicalType))
+ if (const_cast<ASTContext&>(Context).containsAddressDiscriminatedPointerAuth(CanonicalType))
return false;
const auto *RD = CanonicalType->getAsRecordDecl(); // struct/union/class
@@ -3132,7 +3132,7 @@ bool QualType::isCXX11PODType(const ASTContext &Context) const {
return false;
// Any type that is, or contains, address discriminated data is non-POD.
- if (Context.containsAddressDiscriminatedPointerAuth(*this))
+ if (const_cast<ASTContext&>(Context).containsAddressDiscriminatedPointerAuth(*this))
return false;
// As an extension, Clang treats vector types as Scalar types.
diff --git a/clang/lib/Sema/SemaTypeTraits.cpp b/clang/lib/Sema/SemaTypeTraits.cpp
index 79cda40a0edb..21ba19ee551c 100644
--- a/clang/lib/Sema/SemaTypeTraits.cpp
+++ b/clang/lib/Sema/SemaTypeTraits.cpp
@@ -1768,7 +1768,7 @@ static bool EvaluateBinaryTypeTrait(Sema &Self, TypeTrait BTT,
// Objective-C lifetime, this is a non-trivial assignment.
if (LhsT.getNonReferenceType().hasNonTrivialObjCLifetime())
return false;
- const ASTContext &Context = Self.getASTContext();
+ ASTContext &Context = Self.getASTContext();
if (Context.containsAddressDiscriminatedPointerAuth(LhsT) ||
Context.containsAddressDiscriminatedPointerAuth(RhsT))
return false;