forked from OSchip/llvm-project
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:
parent
144b72288a
commit
db74d0b28b
clang/lib/CodeGen
|
@ -880,7 +880,6 @@ llvm::MDNode *CodeGenFunction::getRangeForLoadFromType(QualType Ty) {
|
||||||
CGM.getCodeGenOpts().StrictEnums &&
|
CGM.getCodeGenOpts().StrictEnums &&
|
||||||
!ET->getDecl()->isFixed());
|
!ET->getDecl()->isFixed());
|
||||||
bool IsBool = hasBooleanRepresentation(Ty);
|
bool IsBool = hasBooleanRepresentation(Ty);
|
||||||
llvm::Type *LTy;
|
|
||||||
if (!IsBool && !IsRegularCPlusPlusEnum)
|
if (!IsBool && !IsRegularCPlusPlusEnum)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -889,10 +888,9 @@ llvm::MDNode *CodeGenFunction::getRangeForLoadFromType(QualType Ty) {
|
||||||
if (IsBool) {
|
if (IsBool) {
|
||||||
Min = llvm::APInt(8, 0);
|
Min = llvm::APInt(8, 0);
|
||||||
End = llvm::APInt(8, 2);
|
End = llvm::APInt(8, 2);
|
||||||
LTy = Int8Ty;
|
|
||||||
} else {
|
} else {
|
||||||
const EnumDecl *ED = ET->getDecl();
|
const EnumDecl *ED = ET->getDecl();
|
||||||
LTy = ConvertTypeForMem(ED->getIntegerType());
|
llvm::Type *LTy = ConvertTypeForMem(ED->getIntegerType());
|
||||||
unsigned Bitwidth = LTy->getScalarSizeInBits();
|
unsigned Bitwidth = LTy->getScalarSizeInBits();
|
||||||
unsigned NumNegativeBits = ED->getNumNegativeBits();
|
unsigned NumNegativeBits = ED->getNumNegativeBits();
|
||||||
unsigned NumPositiveBits = ED->getNumPositiveBits();
|
unsigned NumPositiveBits = ED->getNumPositiveBits();
|
||||||
|
|
Loading…
Reference in New Issue