[clang] df575be - [clang][NFC] Add `const` qualifier in `Sema::isIncompatibleTypedef`
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Fri May 17 13:10:18 PDT 2024
Author: Vlad Serebrennikov
Date: 2024-05-17T23:10:12+03:00
New Revision: df575be9d864886684e536cd76c5a96bb0d443a6
URL: https://github.com/llvm/llvm-project/commit/df575be9d864886684e536cd76c5a96bb0d443a6
DIFF: https://github.com/llvm/llvm-project/commit/df575be9d864886684e536cd76c5a96bb0d443a6.diff
LOG: [clang][NFC] Add `const` qualifier in `Sema::isIncompatibleTypedef`
Added:
Modified:
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaDecl.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index cd06bd9c230df..d4d4a82525a02 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -3309,7 +3309,7 @@ class Sema final : public SemaBase {
/// Subroutines of ActOnDeclarator().
TypedefDecl *ParseTypedefDecl(Scope *S, Declarator &D, QualType T,
TypeSourceInfo *TInfo);
- bool isIncompatibleTypedef(TypeDecl *Old, TypedefNameDecl *New);
+ bool isIncompatibleTypedef(const TypeDecl *Old, TypedefNameDecl *New);
/// Describes the kind of merge to perform for availability
/// attributes (including "deprecated", "unavailable", and "availability").
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 6c545d695fc9f..f2b9202255cd4 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -2465,9 +2465,9 @@ NamedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID,
/// entity if their types are the same.
/// FIXME: This is notionally doing the same thing as ASTReaderDecl's
/// isSameEntity.
-static void filterNonConflictingPreviousTypedefDecls(Sema &S,
- TypedefNameDecl *Decl,
- LookupResult &Previous) {
+static void
+filterNonConflictingPreviousTypedefDecls(Sema &S, const TypedefNameDecl *Decl,
+ LookupResult &Previous) {
// This is only interesting when modules are enabled.
if (!S.getLangOpts().Modules && !S.getLangOpts().ModulesLocalVisibility)
return;
@@ -2504,9 +2504,9 @@ static void filterNonConflictingPreviousTypedefDecls(Sema &S,
Filter.done();
}
-bool Sema::isIncompatibleTypedef(TypeDecl *Old, TypedefNameDecl *New) {
+bool Sema::isIncompatibleTypedef(const TypeDecl *Old, TypedefNameDecl *New) {
QualType OldType;
- if (TypedefNameDecl *OldTypedef = dyn_cast<TypedefNameDecl>(Old))
+ if (const TypedefNameDecl *OldTypedef = dyn_cast<TypedefNameDecl>(Old))
OldType = OldTypedef->getUnderlyingType();
else
OldType = Context.getTypeDeclType(Old);
More information about the cfe-commits
mailing list