summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-05-01 17:56:53 +0000
committerTed Kremenek <kremenek@apple.com>2012-05-01 17:56:53 +0000
commitdb74d0b28b6fa52f14baefd80487211d011f47d4 (patch)
tree18557d3c0c448f69c289447c9eeb14d599e0feb3 /clang/lib/CodeGen
parent144b72288a6203b4b9f5db0e05d176be60a4fe45 (diff)
downloadbcm5719-llvm-db74d0b28b6fa52f14baefd80487211d011f47d4.tar.gz
bcm5719-llvm-db74d0b28b6fa52f14baefd80487211d011f47d4.zip
Push variable declaration into nested scope (the only place where it is used). Found by static analyzer.
llvm-svn: 155922
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index a60b4366201..6cbf36dc14b 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/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();
OpenPOWER on IntegriCloud