From cf18ae57176a827b668e059d559ee5f1d6f8f910 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 1 May 2012 17:56:53 +0000 Subject: [PATCH] Push variable declaration into nested scope (the only place where it is used). Found by static analyzer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155922 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index a60b436620..6cbf36dc14 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -880,7 +880,6 @@ llvm::MDNode *CodeGenFunction::getRangeForLoadFromType(QualType Ty) { CGM.getCodeGenOpts().StrictEnums && !ET->getDecl()->isFixed()); bool IsBool = hasBooleanRepresentation(Ty); - llvm::Type *LTy; if (!IsBool && !IsRegularCPlusPlusEnum) return NULL; @@ -889,10 +888,9 @@ llvm::MDNode *CodeGenFunction::getRangeForLoadFromType(QualType Ty) { if (IsBool) { Min = llvm::APInt(8, 0); End = llvm::APInt(8, 2); - LTy = Int8Ty; } else { const EnumDecl *ED = ET->getDecl(); - LTy = ConvertTypeForMem(ED->getIntegerType()); + llvm::Type *LTy = ConvertTypeForMem(ED->getIntegerType()); unsigned Bitwidth = LTy->getScalarSizeInBits(); unsigned NumNegativeBits = ED->getNumNegativeBits(); unsigned NumPositiveBits = ED->getNumPositiveBits(); -- 2.40.0