[cfe-commits] r155922 - /cfe/trunk/lib/CodeGen/CGExpr.cpp

Ted Kremenek kremenek at apple.com
Tue May 1 10:56:54 PDT 2012


Author: kremenek
Date: Tue May  1 12:56:53 2012
New Revision: 155922

URL: http://llvm.org/viewvc/llvm-project?rev=155922&view=rev
Log:
Push variable declaration into nested scope (the only place where it is used).  Found by static analyzer.

Modified:
    cfe/trunk/lib/CodeGen/CGExpr.cpp

Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=155922&r1=155921&r2=155922&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Tue May  1 12:56:53 2012
@@ -880,7 +880,6 @@
                                  CGM.getCodeGenOpts().StrictEnums &&
                                  !ET->getDecl()->isFixed());
   bool IsBool = hasBooleanRepresentation(Ty);
-  llvm::Type *LTy;
   if (!IsBool && !IsRegularCPlusPlusEnum)
     return NULL;
 
@@ -889,10 +888,9 @@
   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();





More information about the cfe-commits mailing list