[cfe-commits] r46087 - /cfe/trunk/Analysis/GRConstants.cpp

Ted Kremenek kremenek at apple.com
Wed Jan 16 11:47:21 PST 2008


Author: kremenek
Date: Wed Jan 16 13:47:19 2008
New Revision: 46087

URL: http://llvm.org/viewvc/llvm-project?rev=46087&view=rev
Log:
Added support from retrieving stored values to variables.

Modified:
    cfe/trunk/Analysis/GRConstants.cpp

Modified: cfe/trunk/Analysis/GRConstants.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Analysis/GRConstants.cpp?rev=46087&r1=46086&r2=46087&view=diff

==============================================================================
--- cfe/trunk/Analysis/GRConstants.cpp (original)
+++ cfe/trunk/Analysis/GRConstants.cpp Wed Jan 16 13:47:19 2008
@@ -40,7 +40,7 @@
 //===----------------------------------------------------------------------===//
 namespace {
 class VISIBILITY_HIDDEN DSPtr {
-  const uintptr_t Raw;
+  uintptr_t Raw;
 public:
   enum  VariantKind { IsDecl=0x1, IsBlkLvl=0x2, IsSubExp=0x3, Flags=0x3 };
   inline void* getPtr() const { return reinterpret_cast<void*>(Raw & ~Flags); }
@@ -218,7 +218,11 @@
 }
 
 ExprVariantTy GRConstants::GetBinding(Expr* E) {
-  DSPtr P(E, getCFG().isBlkExpr(E));
+  DSPtr P(NULL);
+  
+  if (DeclRefExpr* D = dyn_cast<DeclRefExpr>(E)) P = DSPtr(D->getDecl());
+  else P = DSPtr(E, getCFG().isBlkExpr(E));
+
   StateTy::iterator I = CurrentState.find(P);
 
   if (I == CurrentState.end())





More information about the cfe-commits mailing list