diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-09-09 07:13:00 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-09-09 07:13:00 +0000 |
commit | 96ebad66c451d79c9f57b1edb31efaeeb23b9a01 (patch) | |
tree | f8428219f032f53855b775d23964675114d4e70b /include/clang/Checker/PathSensitive | |
parent | 47bb27f16882e4f5ababdd0cf6642bb904a9aaf8 (diff) |
Rename GRState::getSVal() -> getRawSVal() and getSimplifiedSVal() -> getSVal().
The end result is now we eagarly constant-fold symbols in the analyzer that are perfectly constrained
to be a constant value. This allows us to recover some path-sensitivity in some cases by lowering
the required level of reasoning power needed to evaluate some expressions.
The net win from this change is that the false positive in PR 8015 is fixed, and we also
find more idempotent operations bugs.
We do, however, regress with the BugReporterVisitors, which need to be modified to understand
this constant folding (and look past it). This causes some diagnostic regressions in plist-output.m
which will get addressed in a future patch. plist-output.m is now marked XFAIL, while
plist-output-alternate.m now tests that the plist output is working, but with the suboptimal
diagnostics. This second test file will eventually be removed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113477 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Checker/PathSensitive')
-rw-r--r-- | include/clang/Checker/PathSensitive/GRState.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/include/clang/Checker/PathSensitive/GRState.h b/include/clang/Checker/PathSensitive/GRState.h index d72d63ab3c..ac382898d8 100644 --- a/include/clang/Checker/PathSensitive/GRState.h +++ b/include/clang/Checker/PathSensitive/GRState.h @@ -270,12 +270,9 @@ public: SVal getSValAsScalarOrLoc(const Stmt *Ex) const; SVal getSVal(Loc LV, QualType T = QualType()) const; - - /// Returns a "simplified" SVal bound to the location 'LV' in the state's - /// store. A simplified SVal will include optimizations such as - /// if the SVal is a symbol whose value is perfectly constrained then that - /// constant value is returned instead. - SVal getSimplifiedSVal(Loc LV, QualType T= QualType()) const; + + /// Returns the "raw" SVal bound to LV before any value simplfication. + SVal getRawSVal(Loc LV, QualType T= QualType()) const; SVal getSVal(const MemRegion* R) const; @@ -674,7 +671,7 @@ inline SVal GRState::getSValAsScalarOrLoc(const Stmt *S) const { return UnknownVal(); } -inline SVal GRState::getSVal(Loc LV, QualType T) const { +inline SVal GRState::getRawSVal(Loc LV, QualType T) const { return getStateManager().StoreMgr->Retrieve(St, LV, T); } |