[cfe-commits] r50489 - /cfe/trunk/lib/Analysis/GRExprEngine.cpp

Ted Kremenek kremenek at apple.com
Wed Apr 30 10:54:04 PDT 2008


Author: kremenek
Date: Wed Apr 30 12:54:04 2008
New Revision: 50489

URL: http://llvm.org/viewvc/llvm-project?rev=50489&view=rev
Log:
Add conjured symbols for decl initializations.
Add db_error as panic function.

Modified:
    cfe/trunk/lib/Analysis/GRExprEngine.cpp

Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=50489&r1=50488&r2=50489&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Wed Apr 30 12:54:04 2008
@@ -1046,6 +1046,10 @@
             if (!memcmp(s, "assfail", 7)) Builder->BuildSinks = true;
             break;
             
+          case 8:
+            if (!memcmp(s ,"db_error", 8)) Builder->BuildSinks = true;
+            break;
+            
           case 14:
             if (!memcmp(s, "dtrace_assfail", 14)) Builder->BuildSinks = true;
             break;
@@ -1375,9 +1379,24 @@
 
       QualType T = VD->getType();
 
-      if (T->isPointerType() || T->isIntegerType())
-        St = SetRVal(St, lval::DeclVal(VD),
-                     Ex ? GetRVal(St, Ex) : UndefinedVal());
+      if (T->isPointerType() || T->isIntegerType()) {
+        
+        RVal V = Ex ? GetRVal(St, Ex) : UndefinedVal();
+        
+        if (Ex && V.isUnknown()) {
+          
+          // EXPERIMENTAL: "Conjured" symbols.
+
+          unsigned Count = Builder->getCurrentBlockCount();
+          SymbolID Sym = SymMgr.getConjuredSymbol(Ex, Count);
+          
+          V = Ex->getType()->isPointerType()
+            ? cast<RVal>(lval::SymbolVal(Sym)) 
+            : cast<RVal>(nonlval::SymbolVal(Sym));            
+        }
+        
+        St = SetRVal(St, lval::DeclVal(VD), V);        
+      }
     }
 
     // Create a new node.  We don't really need to create a new NodeSet





More information about the cfe-commits mailing list