aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis
AgeCommit message (Collapse)Author
2012-01-25Fix NSLog format string checking for %@.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148885 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24Teach scanf/printf checking about '%Ld' and friends (a GNU extension). ↵Ted Kremenek
Fixes PR 9466. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148859 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24Revert various template unreachability code I committed accidentally.David Blaikie
r148774, r148775, r148776, r148777 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148780 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24More fixes/tests.David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148777 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24Support undefined dependent bases.David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148775 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-20Handle thread safety attributes on functions with separate definitions and ↵DeLesley Hutchins
declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148599 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-20The 'l' length modifier makes sense with the scanlist conversion specifier.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148586 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-20More dead code removal (using -Wunreachable-code)David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148577 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-12scanf: parse the 'm' length modifier, and check that the right argumentsHans Wennborg
are used with that and the 'a' length modifier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148029 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-12scanf analysis: the 'a' length modifier is valid with a scanlistHans Wennborg
Before r148025 we (accidentally) didn't check whether a length modifier is appropriate for a scanlist, but now we do. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148026 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-12scanf analysis: don't bail out after successful parse of scanlistHans Wennborg
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148025 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-11Add elidable CXXConstructExpr as block-level expr. It converts an lvalue to ↵Zhongxing Xu
a rvalue, which is a useful step during AST evaluation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147918 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-06Thread safety analysis: added support for trylock attribute.DeLesley Hutchins
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147672 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-06Added LocalVariableMapDeLesley Hutchins
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147670 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-04Teach the static analyzer to not treat XPC types as CF types.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147506 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-29Support for thread safety attributes on functionsDeLesley Hutchins
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147331 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-28Support the 'a' scanf length modifier as an extension in C++.Hans Wennborg
It should not be supported in C++11, since that uses the C99 standard library, in which 'a' is a format specifier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147310 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-28Enable the user to control whether CXXConstructExpr will be added as a Zhongxing Xu
block-level expr. Currently CXXConstructExpr is always added as a block-level expr. This caused two problems for the analyzer (and potentially for the CFG-based codegen). 1. We have no way to know whether a ctor call is base or complete. 2. We have no way to know the destination object being contructed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147306 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22Colorize and condense CFG pretty-printing.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147203 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22Enhance AnalysisDeclContext::getReferencedBlockVars() to understand ↵Ted Kremenek
PseudoObjExprs. It turns out that the information collected by this method is a super set of the captured variables in BlockDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147122 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22Fix regression in LiveVariables when reasoning about variables captured by ↵Ted Kremenek
blocks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147116 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21Improve CFG pretty-printing for CXXConstructExprs.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147068 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21Improve CFG pretty-printing of CastExprs.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147066 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20Update the CMake build for r146959's new files.Chandler Carruth
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146967 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20Unweaken vtables as per ↵David Blaikie
http://llvm.org/docs/CodingStandards.html#ll_virtual_anch git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146959 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15Keep track of all declarations of an Objective-C class (both forwardDouglas Gregor
declarations and definitions) as ObjCInterfaceDecls within the same redeclaration chain. This new representation matches what we do for C/C++ variables/functions/classes/templates/etc., and makes it possible to answer the query "where are all of the declarations of this class?" git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146679 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15Support the 'a' length modifier in scanf format strings as a C90Hans Wennborg
extension. This fixes gcc.dg/format/c90-scanf-3.c and ext-4.c (test for excess errors). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146649 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-10Check that arguments to a scanf call match the format specifier,Hans Wennborg
and offer fixits when there is a mismatch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146326 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09Remove unnecessary braces from my previous commit.Hans Wennborg
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146259 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09Make printf warnings refer to wint_t and wchar_t by nameHans Wennborg
in addition to underlying type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146254 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09Move definition of ConversionSpecifier::toString() to FormatString.cppHans Wennborg
It's declared in FormatString.h, so it shouldn't be defined in PrintfFormatString.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146253 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09fix format specifier fixit for printf("%ld", "foo");Hans Wennborg
It should reset the length modifier (unless it's a wchar_t string). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146252 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08This patch extends thread safety analysis with support for the ↵DeLesley Hutchins
scoped_lockable attribute. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146174 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07Make printf warnings refer to intmax_t et al. by nameHans Wennborg
in addition to underlying type. For example, the warning for printf("%zu", 42.0); changes from "conversion specifies type 'unsigned long'" to "conversion specifies type 'size_t' (aka 'unsigned long')" (This is a second attempt after r145697, which got reverted.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146032 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-05[analyzer] Rely on LLVM Dominators in Clang dominator computation.Anna Zaks
(Previously, Clang used it's implementation of dominators.) The patch is contributed by Guoping Long! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145858 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-02Revert r145697 and dependent patch r145702. It added a dependency fromNick Lewycky
lib/Analysis to lib/Sema which is cyclical. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145724 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-02Make r145697 actually work.Hans Wennborg
Use the canonical type of the typedef to compare with the underlying type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145702 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-02Make conversion specifier warning refer to typedef if possible.Hans Wennborg
For example, the warning for printf("%zu", 42.0); changes from "conversion specifies type 'unsigned long'" to "conversion specifies type 'size_t' (aka 'unsigned long')" git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145697 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-15Teach the CFG builder how to properly destroy temporaries whoDouglas Gregor
lifetimes have been extended via reference binding. The type of the reference and the type of the temporary are not necessarily the same, which could cause a crash. Fixes <rdar://problem/10398199>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144646 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-14[analyzer] teach AnalysisDeclContext::getSelfDecl() about blocks that ↵Ted Kremenek
capture the 'self' variable of the enclosing ObjC method decl. Fixes <rdar://problem/10380300>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144556 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09We don't add ExprWithCleanups to the CFG, and getSVal looksJohn McCall
through it, so we should look through it for the live-values analysis as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144190 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-06Change the AST representation of operations on Objective-CJohn McCall
property references to use a new PseudoObjectExpr expression which pairs a syntactic form of the expression with a set of semantic expressions implementing it. This should significantly reduce the complexity required elsewhere in the compiler to deal with these kinds of expressions (e.g. IR generation's special l-value kind, the static analyzer's Message abstraction), at the lower cost of specifically dealing with the odd AST structure of these expressions. It should also greatly simplify efforts to implement similar language features in the future, most notably Managed C++'s properties and indexed properties. Most of the effort here is in dealing with the various clients of the AST. I've gone ahead and simplified the ObjC rewriter's use of properties; other clients, like IR-gen and the static analyzer, have all the old complexity *and* all the new complexity, at least temporarily. Many thanks to Ted for writing and advising on the necessary changes to the static analyzer. I've xfailed a small diagnostics regression in the static analyzer at Ted's request. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143867 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05Tweak LookThroughStmt() in LiveVariables to properly look through ↵Ted Kremenek
alternativing ParenExprs and OpaqueValueExprs. Thanks to Anna and Argiris for iterating on this function. My original patch embarssingly didn't even pass the Clang tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143797 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05LookThroughStmt GM release.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143796 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05LookThroughStmt v4.6.3Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143795 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05Simplify LookThroughStmt in LiveVariables.cppArgyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143794 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05Another correction to the LiveVariables commit (r143767, r143780).Anna Zaks
Make test/Analysis/misc-ps.c test pass. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143790 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05Fix infinite loop in LiveVariables due to a misplaced 'break' (it would ↵Argyrios Kyrtzidis
break out of switch statement, not the while loop). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143780 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05Teach LiveVariables to look through OpaqueValueExprs for extending Stmt ↵Ted Kremenek
liveness. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143767 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05Per discussion with John McCall, don't add OpaqueValueExprs to the CFG.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143766 91177308-0d34-0410-b5e6-96231b3b80d8