]> granicus.if.org Git - clang/commitdiff
Convert use of loc::SymbolVal and nonloc::SymbolVal to V.getAsSymbol(). This
authorTed Kremenek <kremenek@apple.com>
Mon, 30 Mar 2009 18:39:15 +0000 (18:39 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 30 Mar 2009 18:39:15 +0000 (18:39 +0000)
also makes this code more correct as it transparently handles SVals that wrapped
TypedViewRegions(SymbolicRegions).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68048 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/BugReporter.cpp

index f5ba3275b9b95b2a54d2f6117f0272db247a235a..a240062ef7199a10676a5f354ef8976d2171028f 100644 (file)
@@ -537,18 +537,11 @@ public:
                        PathDiagnostic& pd, BugReporter& br)
     : Sym(sym), PrevSt(prevst), S(s), VMgr(vmgr), Pred(pred), PD(pd), BR(br) {}
                         
-  bool HandleBinding(StoreManager& SMgr, Store store,
-                     const MemRegion* R, SVal V) {
+  bool HandleBinding(StoreManager& SMgr, Store store, const MemRegion* R,
+                     SVal V) {
+
+    SymbolRef ScanSym = V.getAsSymbol();
 
-    SymbolRef ScanSym = 0;
-    
-    if (loc::SymbolVal* SV = dyn_cast<loc::SymbolVal>(&V))
-      ScanSym = SV->getSymbol();
-    else if (nonloc::SymbolVal* SV = dyn_cast<nonloc::SymbolVal>(&V))
-      ScanSym = SV->getSymbol();
-    else
-      return true;
-    
     if (ScanSym != Sym)
       return true;