summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/BugReporter.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-03-30 18:39:15 +0000
committerTed Kremenek <kremenek@apple.com>2009-03-30 18:39:15 +0000
commita53eb7fa80dd5eff7d03685e55b1f77ec4735a43 (patch)
tree8ba8e2f8a40b2bc1768151075530c9aede2e036b /clang/lib/Analysis/BugReporter.cpp
parent7a78f3abd3781b356d0d25762a1b70e70a0f0a66 (diff)
downloadbcm5719-llvm-a53eb7fa80dd5eff7d03685e55b1f77ec4735a43.tar.gz
bcm5719-llvm-a53eb7fa80dd5eff7d03685e55b1f77ec4735a43.zip
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
Diffstat (limited to 'clang/lib/Analysis/BugReporter.cpp')
-rw-r--r--clang/lib/Analysis/BugReporter.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/clang/lib/Analysis/BugReporter.cpp b/clang/lib/Analysis/BugReporter.cpp
index f5ba3275b9b..a240062ef71 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<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;
OpenPOWER on IntegriCloud