diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-08-21 11:00:26 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-08-21 11:00:26 +0000 |
commit | 46d1a4f046e5a7d35a7857be271b6701823542fa (patch) | |
tree | af56dca674717f5ba26dc54c892c48ec677c6aac /lib/Checker/SVals.cpp | |
parent | d226f65006733ed7f709c3174f22ce33391cb58f (diff) |
Remove a special case for OSAtomic functions. We can already bind and retrieve
with the same binding key. The only trick here is that sometimes the Symbolic
region is stored in with an LocAsInteger wrapper. We unwrap that in
SVal::getAsLocSymbol().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111734 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/SVals.cpp')
-rw-r--r-- | lib/Checker/SVals.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Checker/SVals.cpp b/lib/Checker/SVals.cpp index 7a99e8681d..3248b0fea2 100644 --- a/lib/Checker/SVals.cpp +++ b/lib/Checker/SVals.cpp @@ -62,6 +62,9 @@ const FunctionDecl *SVal::getAsFunctionDecl() const { /// wraps a symbol, return that SymbolRef. Otherwise return 0. // FIXME: should we consider SymbolRef wrapped in CodeTextRegion? SymbolRef SVal::getAsLocSymbol() const { + if (const nonloc::LocAsInteger *X = dyn_cast<nonloc::LocAsInteger>(this)) + return X->getLoc().getAsLocSymbol(); + if (const loc::MemRegionVal *X = dyn_cast<loc::MemRegionVal>(this)) { const MemRegion *R = X->StripCasts(); if (const SymbolicRegion *SymR = dyn_cast<SymbolicRegion>(R)) |