Push variable declaration into nested scope (the only place where it is used). Found by static analyzer.

llvm-svn: 155922
This commit is contained in:
Ted Kremenek 2012-05-01 17:56:53 +00:00
parent 144b72288a
commit db74d0b28b
1 changed files with 1 additions and 3 deletions

View File

@ -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();