From a53eb7fa80dd5eff7d03685e55b1f77ec4735a43 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 30 Mar 2009 18:39:15 +0000 Subject: [PATCH] Convert use of loc::SymbolVal and nonloc::SymbolVal to V.getAsSymbol(). This also makes this code more correct as it transparently handles SVals that wrapped TypedViewRegions(SymbolicRegions). llvm-svn: 68048 --- clang/lib/Analysis/BugReporter.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/clang/lib/Analysis/BugReporter.cpp b/clang/lib/Analysis/BugReporter.cpp index f5ba3275b9b9..a240062ef719 100644 --- a/clang/lib/Analysis/BugReporter.cpp +++ b/clang/lib/Analysis/BugReporter.cpp @@ -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(&V)) - ScanSym = SV->getSymbol(); - else if (nonloc::SymbolVal* SV = dyn_cast(&V)) - ScanSym = SV->getSymbol(); - else - return true; - if (ScanSym != Sym) return true;