[clang] [clang][NFC] Make ASTContext::getPointerAuthTypeDiscriminator const (PR #122931)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 14 08:35:46 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Timm Baeder (tbaederr)
<details>
<summary>Changes</summary>
Can be const, should be const.
---
Full diff: https://github.com/llvm/llvm-project/pull/122931.diff
2 Files Affected:
- (modified) clang/include/clang/AST/ASTContext.h (+1-1)
- (modified) clang/lib/AST/ASTContext.cpp (+1-1)
``````````diff
diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h
index 0e07c5d6ce8fba..6ed6dd00f5bc70 100644
--- a/clang/include/clang/AST/ASTContext.h
+++ b/clang/include/clang/AST/ASTContext.h
@@ -1343,7 +1343,7 @@ class ASTContext : public RefCountedBase<ASTContext> {
getPointerAuthVTablePointerDiscriminator(const CXXRecordDecl *RD);
/// Return the "other" type-specific discriminator for the given type.
- uint16_t getPointerAuthTypeDiscriminator(QualType T);
+ uint16_t getPointerAuthTypeDiscriminator(QualType T) const;
/// Apply Objective-C protocol qualifiers to the given type.
/// \param allowOnPointerType specifies if we can apply protocol
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index be1dd29d462788..a6694aeda05f6d 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -3489,7 +3489,7 @@ static void encodeTypeForFunctionPointerAuth(const ASTContext &Ctx,
}
}
-uint16_t ASTContext::getPointerAuthTypeDiscriminator(QualType T) {
+uint16_t ASTContext::getPointerAuthTypeDiscriminator(QualType T) const {
assert(!T->isDependentType() &&
"cannot compute type discriminator of a dependent type");
``````````
</details>
https://github.com/llvm/llvm-project/pull/122931
More information about the cfe-commits
mailing list