diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-08-28 17:07:04 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-08-28 17:07:04 +0000 |
commit | acd080b956d8a0007a36ca6727977cdfd5c284db (patch) | |
tree | cd54e2f9f8083ac8a10fb1400d0044383b72b897 /clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.h | |
parent | 5c6235968f50a90f4c68012efbeb006903279fde (diff) | |
download | bcm5719-llvm-acd080b956d8a0007a36ca6727977cdfd5c284db.tar.gz bcm5719-llvm-acd080b956d8a0007a36ca6727977cdfd5c284db.zip |
[analyzer] Add support for testing the presence of weak functions.
When casting the address of a FunctionTextRegion to bool, or when adding
constraints to such an address, use a stand-in symbol to represent the
presence or absence of the function if the function is weakly linked.
This is groundwork for possible simple availability testing checks, and
can already catch mistakes involving inverted null checks for
weakly-linked functions.
Currently, the implementation reuses the "extent" symbols, originally created
for tracking the size of a malloc region. Since FunctionTextRegions cannot
be dereferenced, the extent symbol will never be used for anything else.
Still, this probably deserves a refactoring in the future.
This patch does not attempt to support testing the presence of weak
/variables/ (global variables), which would likely require much more of
a change and a generalization of "region structure metadata", like the
current "extents", vs. "region contents metadata", like CStringChecker's
"string length".
Patch by Richard <tarka.t.otter@googlemail.com>!
llvm-svn: 189492
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.h')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.h | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.h b/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.h index 10ddef1341c..28a9a4ded9d 100644 --- a/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.h +++ b/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.h @@ -36,8 +36,6 @@ public: ProgramStateRef assume(ProgramStateRef state, DefinedSVal Cond, bool Assumption); - ProgramStateRef assume(ProgramStateRef state, Loc Cond, bool Assumption); - ProgramStateRef assume(ProgramStateRef state, NonLoc Cond, bool Assumption); ProgramStateRef assumeSymRel(ProgramStateRef state, @@ -87,10 +85,6 @@ protected: bool canReasonAbout(SVal X) const; ProgramStateRef assumeAux(ProgramStateRef state, - Loc Cond, - bool Assumption); - - ProgramStateRef assumeAux(ProgramStateRef state, NonLoc Cond, bool Assumption); |