[cfe-commits] r47624 - /cfe/trunk/Analysis/ValueState.cpp

Ted Kremenek kremenek at apple.com
Tue Feb 26 13:04:29 PST 2008


Author: kremenek
Date: Tue Feb 26 15:04:29 2008
New Revision: 47624

URL: http://llvm.org/viewvc/llvm-project?rev=47624&view=rev
Log:
Removed hack with toggling the signedness flag of the APSInt stored
in an EnumConstantDecl.  This was made possible because of a recent fix
in the parser:

http://llvm.org/viewvc/llvm-project?rev=47581&view=rev

Modified:
    cfe/trunk/Analysis/ValueState.cpp

Modified: cfe/trunk/Analysis/ValueState.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Analysis/ValueState.cpp?rev=47624&r1=47623&r2=47624&view=diff

==============================================================================
--- cfe/trunk/Analysis/ValueState.cpp (original)
+++ cfe/trunk/Analysis/ValueState.cpp Tue Feb 26 15:04:29 2008
@@ -246,15 +246,8 @@
           // already has persistent storage?  We do this because we
           // are comparing states using pointer equality.  Perhaps there is
           // a better way, since APInts are fairly lightweight.
-          llvm::APSInt X = ED->getInitVal();
-          
-          // FIXME: This is a hack.  The APSInt inside the EnumConstantDecl
-          //  might not match the signedness of the DeclRefExpr.  We hack
-          //  a workaround here.  Should be fixed elsewhere.
-          if (E->getType()->isUnsignedIntegerType() != X.isUnsigned())
-            X.setIsUnsigned(!X.isUnsigned());
-          
-          return nonlval::ConcreteInt(ValMgr.getValue(X));          
+
+          return nonlval::ConcreteInt(ValMgr.getValue(ED->getInitVal()));          
         }
         else if (FunctionDecl* FD = dyn_cast<FunctionDecl>(D))
           return lval::FuncVal(FD);





More information about the cfe-commits mailing list