Enhance SimpleSValuator to handle nonloc::LocAsInteger -> location casts.

llvm-svn: 76481
diff --git a/clang/lib/Analysis/SimpleSValuator.cpp b/clang/lib/Analysis/SimpleSValuator.cpp
index 58b1696..4f8c29c 100644
--- a/clang/lib/Analysis/SimpleSValuator.cpp
+++ b/clang/lib/Analysis/SimpleSValuator.cpp
@@ -44,11 +44,16 @@
 // Transfer function for Casts.
 //===----------------------------------------------------------------------===//
 
-SVal SimpleSValuator::EvalCastNL(NonLoc val, QualType castTy) {  
+SVal SimpleSValuator::EvalCastNL(NonLoc val, QualType castTy) {
+  
+  bool isLocType = Loc::IsLocType(castTy);
+  
+  if (isLocType)
+    if (nonloc::LocAsInteger *LI = dyn_cast<nonloc::LocAsInteger>(&val))
+      return LI->getLoc();
+  
   if (!isa<nonloc::ConcreteInt>(val))
     return UnknownVal();
-
-  bool isLocType = Loc::IsLocType(castTy);
   
   // Only handle casts from integers to integers.
   if (!isLocType && !castTy->isIntegerType())