From 025941785faf25a3d9ba2c1e7682ca6c2ad063af Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 13 Jan 2020 14:41:16 +0000 Subject: [PATCH] Fix some cppcheck shadow variable warnings. NFCI. --- clang/lib/AST/ASTContext.cpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 0b2d8b4..481affa 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -3608,10 +3608,10 @@ ASTContext::getDependentVectorType(QualType VecType, Expr *SizeExpr, (void)CanonCheck; DependentVectorTypes.InsertNode(New, InsertPos); } else { - QualType Canon = getDependentSizedExtVectorType(CanonVecTy, SizeExpr, - SourceLocation()); + QualType CanonExtTy = getDependentSizedExtVectorType(CanonVecTy, SizeExpr, + SourceLocation()); New = new (*this, TypeAlignment) DependentVectorType( - *this, VecType, Canon, SizeExpr, AttrLoc, VecKind); + *this, VecType, CanonExtTy, SizeExpr, AttrLoc, VecKind); } } @@ -3681,10 +3681,10 @@ ASTContext::getDependentSizedExtVectorType(QualType vecType, (void)CanonCheck; DependentSizedExtVectorTypes.InsertNode(New, InsertPos); } else { - QualType Canon = getDependentSizedExtVectorType(CanonVecTy, SizeExpr, - SourceLocation()); - New = new (*this, TypeAlignment) - DependentSizedExtVectorType(*this, vecType, Canon, SizeExpr, AttrLoc); + QualType CanonExtTy = getDependentSizedExtVectorType(CanonVecTy, SizeExpr, + SourceLocation()); + New = new (*this, TypeAlignment) DependentSizedExtVectorType( + *this, vecType, CanonExtTy, SizeExpr, AttrLoc); } } @@ -6875,21 +6875,19 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string &S, S += ObjCEncodingForEnumType(this, cast(CT)); return; - case Type::Complex: { - const auto *CT = T->castAs(); + case Type::Complex: S += 'j'; - getObjCEncodingForTypeImpl(CT->getElementType(), S, ObjCEncOptions(), + getObjCEncodingForTypeImpl(T->castAs()->getElementType(), S, + ObjCEncOptions(), /*Field=*/nullptr); return; - } - case Type::Atomic: { - const auto *AT = T->castAs(); + case Type::Atomic: S += 'A'; - getObjCEncodingForTypeImpl(AT->getValueType(), S, ObjCEncOptions(), + getObjCEncodingForTypeImpl(T->castAs()->getValueType(), S, + ObjCEncOptions(), /*Field=*/nullptr); return; - } // encoding for pointer or reference types. case Type::Pointer: -- 2.7.4