summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* Handle thread safety attributes on functions with separate definitions and ↵DeLesley Hutchins2012-01-201-24/+25
| | | | | | declarations. llvm-svn: 148599
* The 'l' length modifier makes sense with the scanlist conversion specifier.Ted Kremenek2012-01-201-0/+1
| | | | llvm-svn: 148586
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-204-13/+5
| | | | llvm-svn: 148577
* scanf: parse the 'm' length modifier, and check that the right argumentsHans Wennborg2012-01-123-3/+37
| | | | | | are used with that and the 'a' length modifier. llvm-svn: 148029
* scanf analysis: the 'a' length modifier is valid with a scanlistHans Wennborg2012-01-121-0/+1
| | | | | | | Before r148025 we (accidentally) didn't check whether a length modifier is appropriate for a scanlist, but now we do. llvm-svn: 148026
* scanf analysis: don't bail out after successful parse of scanlistHans Wennborg2012-01-121-1/+1
| | | | llvm-svn: 148025
* Add elidable CXXConstructExpr as block-level expr. It converts an lvalue to ↵Zhongxing Xu2012-01-111-2/+1
| | | | | | a rvalue, which is a useful step during AST evaluation. llvm-svn: 147918
* Thread safety analysis: added support for trylock attribute.DeLesley Hutchins2012-01-061-3/+123
| | | | llvm-svn: 147672
* Added LocalVariableMapDeLesley Hutchins2012-01-061-44/+536
| | | | llvm-svn: 147670
* Teach the static analyzer to not treat XPC types as CF types.Ted Kremenek2012-01-041-1/+3
| | | | llvm-svn: 147506
* Support for thread safety attributes on functionsDeLesley Hutchins2011-12-291-2/+5
| | | | llvm-svn: 147331
* Support the 'a' scanf length modifier as an extension in C++.Hans Wennborg2011-12-281-1/+1
| | | | | | | It should not be supported in C++11, since that uses the C99 standard library, in which 'a' is a format specifier. llvm-svn: 147310
* Enable the user to control whether CXXConstructExpr will be added as a Zhongxing Xu2011-12-281-1/+1
| | | | | | | | | | 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. llvm-svn: 147306
* Colorize and condense CFG pretty-printing.Ted Kremenek2011-12-222-49/+92
| | | | llvm-svn: 147203
* Enhance AnalysisDeclContext::getReferencedBlockVars() to understand ↵Ted Kremenek2011-12-222-5/+16
| | | | | | | | PseudoObjExprs. It turns out that the information collected by this method is a super set of the captured variables in BlockDecl. llvm-svn: 147122
* Fix regression in LiveVariables when reasoning about variables captured by ↵Ted Kremenek2011-12-221-5/+4
| | | | | | blocks. llvm-svn: 147116
* Improve CFG pretty-printing for CXXConstructExprs.Ted Kremenek2011-12-211-0/+3
| | | | llvm-svn: 147068
* Improve CFG pretty-printing of CastExprs.Ted Kremenek2011-12-211-1/+8
| | | | llvm-svn: 147066
* Update the CMake build for r146959's new files.Chandler Carruth2011-12-201-0/+1
| | | | llvm-svn: 146967
* Unweaken vtables as per ↵David Blaikie2011-12-204-1/+21
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146959
* Keep track of all declarations of an Objective-C class (both forwardDouglas Gregor2011-12-151-1/+1
| | | | | | | | | | 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?" llvm-svn: 146679
* Support the 'a' length modifier in scanf format strings as a C90Hans Wennborg2011-12-154-12/+55
| | | | | | | | | extension. This fixes gcc.dg/format/c90-scanf-3.c and ext-4.c (test for excess errors). llvm-svn: 146649
* Check that arguments to a scanf call match the format specifier,Hans Wennborg2011-12-101-1/+252
| | | | | | and offer fixits when there is a mismatch. llvm-svn: 146326
* Remove unnecessary braces from my previous commit.Hans Wennborg2011-12-091-2/+1
| | | | llvm-svn: 146259
* Make printf warnings refer to wint_t and wchar_t by nameHans Wennborg2011-12-092-11/+13
| | | | | | in addition to underlying type. llvm-svn: 146254
* Move definition of ConversionSpecifier::toString() to FormatString.cppHans Wennborg2011-12-092-44/+41
| | | | | | | It's declared in FormatString.h, so it shouldn't be defined in PrintfFormatString.cpp. llvm-svn: 146253
* fix format specifier fixit for printf("%ld", "foo");Hans Wennborg2011-12-091-0/+2
| | | | | | It should reset the length modifier (unless it's a wchar_t string). llvm-svn: 146252
* This patch extends thread safety analysis with support for the ↵DeLesley Hutchins2011-12-081-33/+74
| | | | | | scoped_lockable attribute. llvm-svn: 146174
* Make printf warnings refer to intmax_t et al. by nameHans Wennborg2011-12-072-6/+16
| | | | | | | | | | | | 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.) llvm-svn: 146032
* [analyzer] Rely on LLVM Dominators in Clang dominator computation.Anna Zaks2011-12-053-162/+1
| | | | | | | | (Previously, Clang used it's implementation of dominators.) The patch is contributed by Guoping Long! llvm-svn: 145858
* Revert r145697 and dependent patch r145702. It added a dependency fromNick Lewycky2011-12-022-40/+18
| | | | | | lib/Analysis to lib/Sema which is cyclical. llvm-svn: 145724
* Make r145697 actually work.Hans Wennborg2011-12-021-1/+1
| | | | | | Use the canonical type of the typedef to compare with the underlying type. llvm-svn: 145702
* Make conversion specifier warning refer to typedef if possible.Hans Wennborg2011-12-022-18/+40
| | | | | | | | 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')" llvm-svn: 145697
* Teach the CFG builder how to properly destroy temporaries whoDouglas Gregor2011-11-151-8/+57
| | | | | | | | 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>. llvm-svn: 144646
* [analyzer] teach AnalysisDeclContext::getSelfDecl() about blocks that ↵Ted Kremenek2011-11-141-0/+9
| | | | | | capture the 'self' variable of the enclosing ObjC method decl. Fixes <rdar://problem/10380300>. llvm-svn: 144556
* We don't add ExprWithCleanups to the CFG, and getSVal looksJohn McCall2011-11-091-0/+4
| | | | | | | through it, so we should look through it for the live-values analysis as well. llvm-svn: 144190
* Change the AST representation of operations on Objective-CJohn McCall2011-11-062-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 143867
* Tweak LookThroughStmt() in LiveVariables to properly look through ↵Ted Kremenek2011-11-051-4/+9
| | | | | | 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. llvm-svn: 143797
* LookThroughStmt GM release.Argyrios Kyrtzidis2011-11-051-2/+2
| | | | llvm-svn: 143796
* LookThroughStmt v4.6.3Argyrios Kyrtzidis2011-11-051-1/+1
| | | | llvm-svn: 143795
* Simplify LookThroughStmt in LiveVariables.cppArgyrios Kyrtzidis2011-11-051-12/+4
| | | | llvm-svn: 143794
* Another correction to the LiveVariables commit (r143767, r143780).Anna Zaks2011-11-051-3/+7
| | | | | | Make test/Analysis/misc-ps.c test pass. llvm-svn: 143790
* Fix infinite loop in LiveVariables due to a misplaced 'break' (it would ↵Argyrios Kyrtzidis2011-11-051-12/+6
| | | | | | | | break out of switch statement, not the while loop). llvm-svn: 143780
* Teach LiveVariables to look through OpaqueValueExprs for extending Stmt ↵Ted Kremenek2011-11-051-10/+28
| | | | | | liveness. llvm-svn: 143767
* Per discussion with John McCall, don't add OpaqueValueExprs to the CFG.Ted Kremenek2011-11-051-1/+4
| | | | llvm-svn: 143766
* Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it willRichard Smith2011-10-291-1/+1
| | | | | | | | implicitly perform an lvalue-to-rvalue conversion if used on an lvalue expression. Also improve the documentation of Expr::Evaluate* to indicate which of them will accept expressions with side-effects. llvm-svn: 143263
* Teach format string analysis that "%zu" means size_t.Hans Wennborg2011-10-271-9/+5
| | | | | | | | The code had it backwards, thinking size_t was signed, and using that for "%zd". Also let the analysis get the types for (u)intmax_t while we are at it. llvm-svn: 143099
* Tweak printf format string parsing to accept 'hh' conversion specifier to ↵Ted Kremenek2011-10-252-6/+22
| | | | | | accept any char, not just signed char. Fixes <rdar://problem/10303638>. llvm-svn: 142908
* Add source-level dominators analysis. Patch by Guoping Long!Ted Kremenek2011-10-252-0/+161
| | | | llvm-svn: 142885
* Actually rename the file AnalysisContext.cpp -> AnalysisDeclContext.cppChandler Carruth2011-10-241-0/+0
| | | | | | | to match the CMakeLists.txt change in r142782; this should fix the CMake build. llvm-svn: 142784
OpenPOWER on IntegriCloud