Used conjured symbols to recover path-sensitivity when the result of a compound assignment is UnknownVal().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57851 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index 98fa58f..94fbf35 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -2204,6 +2204,19 @@
           
           continue;
         }
+
+        // EXPERIMENTAL: "Conjured" symbols.
+        // FIXME: Handle structs.
+        QualType T = RHS->getType();
+        
+        if (Result.isUnknown() && (T->isIntegerType() || Loc::IsLocType(T))) {            
+          unsigned Count = Builder->getCurrentBlockCount();
+          SymbolID Sym = SymMgr.getConjuredSymbol(B->getRHS(), Count);
+          
+          Result = Loc::IsLocType(B->getRHS()->getType()) 
+                 ? cast<SVal>(loc::SymbolVal(Sym)) 
+                 : cast<SVal>(nonloc::SymbolVal(Sym));            
+        }
  
         EvalStore(Dst, B, LHS, *I3, SetSVal(St, B, Result), location, Result);
       }