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

Ted Kremenek kremenek at apple.com
Wed Jan 30 18:35:41 PST 2008


Author: kremenek
Date: Wed Jan 30 20:35:41 2008
New Revision: 46595

URL: http://llvm.org/viewvc/llvm-project?rev=46595&view=rev
Log:
Added transfer function support for unary '&' and '*', providing basic
(local) aliasing support.

Modified ExplodedGraph pretty-printer (for GRConstants) to also print out the
pointer value of the state associated with a node.  This way one can easily
see that two states are identical.

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=46595&r1=46594&r2=46595&view=diff

==============================================================================
--- cfe/trunk/Analysis/GRConstants.cpp (original)
+++ cfe/trunk/Analysis/GRConstants.cpp Wed Jan 30 20:35:41 2008
@@ -1,5 +1,5 @@
 //===-- GRConstants.cpp - Simple, Path-Sens. Constant Prop. ------*- C++ -*-==//
-//   
+//
 //                     The LLValM Compiler Infrastructure
 //
 // This file is distributed under the University of Illinois Open Source
@@ -733,7 +733,8 @@
       break;
       
     case LValueDeclKind:
-      Out << cast<LValueDecl>(this)->getDecl()->getIdentifier();
+      Out << '&' 
+          << cast<LValueDecl>(this)->getDecl()->getIdentifier()->getName();
       break;
       
     default:
@@ -1277,6 +1278,18 @@
         break;
       }
         
+      case UnaryOperator::AddrOf: {
+        const LValue& L1 = GetLValue(St, U->getSubExpr());
+        Nodify(Dst, U, N1, SetValue(St, U, L1));
+        break;
+      }
+        
+      case UnaryOperator::Deref: {
+        const LValue& L1 = GetLValue(St, U->getSubExpr());
+        Nodify(Dst, U, N1, SetValue(St, U, GetValue(St, L1)));
+        break;
+      }
+        
       default: ;
         assert (false && "Not implemented.");
     }    
@@ -1608,7 +1621,7 @@
       }
     }
     
-    Out << "\\|";
+    Out << "\\|StateID: " << (void*) N->getState().getRoot() << "\\|";
     
     PrintKind(Out, N->getState(), ValueKey::IsDecl, true);
     PrintKind(Out, N->getState(), ValueKey::IsBlkExpr);





More information about the cfe-commits mailing list