[clang] 0566f97 - [clang][NFC] remove unused return value
Nathan Sidwell via cfe-commits
cfe-commits at lists.llvm.org
Fri May 14 05:27:14 PDT 2021
Author: Nathan Sidwell
Date: 2021-05-14T05:25:47-07:00
New Revision: 0566f979619cf49a62804a7e3530438f1319fa7c
URL: https://github.com/llvm/llvm-project/commit/0566f979619cf49a62804a7e3530438f1319fa7c
DIFF: https://github.com/llvm/llvm-project/commit/0566f979619cf49a62804a7e3530438f1319fa7c.diff
LOG: [clang][NFC] remove unused return value
In working on p0388 (ary[N] -> ary[] conversion), I discovered neither
use of UnwrapSimilarArrayTypes used the return value. So let's nuke
it.
Differential Revision: https://reviews.llvm.org/D102480
Added:
Modified:
clang/include/clang/AST/ASTContext.h
clang/lib/AST/ASTContext.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h
index 6ebdca06d58ff..be6170564fcd0 100644
--- a/clang/include/clang/AST/ASTContext.h
+++ b/clang/include/clang/AST/ASTContext.h
@@ -2455,7 +2455,7 @@ class ASTContext : public RefCountedBase<ASTContext> {
const ObjCMethodDecl *MethodImp);
bool UnwrapSimilarTypes(QualType &T1, QualType &T2);
- bool UnwrapSimilarArrayTypes(QualType &T1, QualType &T2);
+ void UnwrapSimilarArrayTypes(QualType &T1, QualType &T2);
/// Determine if two types are similar, according to the C++ rules. That is,
/// determine if they are the same other than qualifiers on the initial
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 6eb8da7411237..06f232557708b 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -5766,29 +5766,29 @@ QualType ASTContext::getUnqualifiedArrayType(QualType type,
/// Attempt to unwrap two types that may both be array types with the same bound
/// (or both be array types of unknown bound) for the purpose of comparing the
/// cv-decomposition of two types per C++ [conv.qual].
-bool ASTContext::UnwrapSimilarArrayTypes(QualType &T1, QualType &T2) {
- bool UnwrappedAny = false;
+void ASTContext::UnwrapSimilarArrayTypes(QualType &T1, QualType &T2) {
while (true) {
auto *AT1 = getAsArrayType(T1);
- if (!AT1) return UnwrappedAny;
+ if (!AT1)
+ return;
auto *AT2 = getAsArrayType(T2);
- if (!AT2) return UnwrappedAny;
+ if (!AT2)
+ return;
// If we don't have two array types with the same constant bound nor two
// incomplete array types, we've unwrapped everything we can.
if (auto *CAT1 = dyn_cast<ConstantArrayType>(AT1)) {
auto *CAT2 = dyn_cast<ConstantArrayType>(AT2);
if (!CAT2 || CAT1->getSize() != CAT2->getSize())
- return UnwrappedAny;
+ return;
} else if (!isa<IncompleteArrayType>(AT1) ||
!isa<IncompleteArrayType>(AT2)) {
- return UnwrappedAny;
+ return;
}
T1 = AT1->getElementType();
T2 = AT2->getElementType();
- UnwrappedAny = true;
}
}
More information about the cfe-commits
mailing list