From acd080b956d8a0007a36ca6727977cdfd5c284db Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Wed, 28 Aug 2013 17:07:04 +0000 Subject: [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 ! llvm-svn: 189492 --- clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.h') 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, @@ -86,10 +84,6 @@ protected: bool canReasonAbout(SVal X) const; - ProgramStateRef assumeAux(ProgramStateRef state, - Loc Cond, - bool Assumption); - ProgramStateRef assumeAux(ProgramStateRef state, NonLoc Cond, bool Assumption); -- cgit v1.2.3