summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* Fix horrific CFG bug where '@autoreleasepool' would be put in a dangling ↵Ted Kremenek2012-03-061-0/+10
| | | | | | block in the CFG. llvm-svn: 152163
* Thread safety analysis: expand set of expressions that can be used to denote ↵DeLesley Hutchins2012-03-021-6/+50
| | | | | | locks. llvm-svn: 151956
* Thread safety analysis: handle CFG blocks which call functions marked as ↵DeLesley Hutchins2012-03-021-0/+4
| | | | | | noreturn. llvm-svn: 151944
* Move llvm/ADT/SaveAndRestore.h -> llvm/Support/SaveAndRestore.h.Argyrios Kyrtzidis2012-03-013-3/+3
| | | | | | Needs llvm update. llvm-svn: 151829
* Move "clang/Analysis/Support/SaveAndRestore.h" to "llvm/ADT/SaveAndRestore.h"Argyrios Kyrtzidis2012-02-273-3/+3
| | | | | | | | to make it more widely available. Depends on llvm commit r151564 llvm-svn: 151566
* Warn about non-standard format strings (pr12017)Hans Wennborg2012-02-221-0/+71
| | | | | | | | | This adds the -Wformat-non-standard flag (off by default, enabled by -pedantic), which warns about non-standard things in format strings (such as the 'q' length modifier, the 'S' conversion specifier, etc.) llvm-svn: 151154
* Thread-safety analysis: Disable checking inside constructors, destructors, ↵DeLesley Hutchins2012-02-161-6/+24
| | | | | | lock, and unlock functions llvm-svn: 150701
* Thread-Safety: added support for 'this' as a lock expression.DeLesley Hutchins2012-02-161-3/+7
| | | | llvm-svn: 150700
* Format string analysis: give 'q' its own enumerator.Hans Wennborg2012-02-163-6/+16
| | | | | | | | | This is in preparation for being able to warn about 'q' and other non-standard format string features. It also allows us to print its name correctly. llvm-svn: 150697
* Make -Wformat fix-its preserve original conversion specifiers.Hans Wennborg2012-02-152-12/+18
| | | | | | | | | | | | | | | | | This commit makes PrintfSpecifier::fixType() and ScanfSpecifier::fixType() only fix a conversion specification enough that Clang wouldn't warn about it, as opposed to always changing it to use the "canonical" conversion specifier. (PR11975) This preserves the user's choice of conversion specifier in cases like: printf("%a", (long double)1); where we previously suggested "%Lf", we now suggest "%La" printf("%x", (long)1); where we previously suggested "%ld", we now suggest "%lx". llvm-svn: 150578
* Tweak format string checking to work with %@ and ObjC toll-free bridging. ↵Ted Kremenek2012-02-061-3/+17
| | | | | | <rdar://problem/10814120> llvm-svn: 149907
* Basic: import OwningPtr<> into clang namespaceDylan Noblesmith2012-02-051-1/+1
| | | | llvm-svn: 149798
* Thread safety analysis:Richard Smith2012-02-031-13/+83
| | | | | | | | | | | | * When we detect that a CFG block has inconsistent lock sets, point the diagnostic at the location where we found the inconsistency, and point a note at somewhere the inconsistently-locked mutex was locked. * Fix the wording of the normal (non-loop, non-end-of-function) case of this diagnostic to not suggest that the mutex is going out of scope. * Fix the diagnostic emission code to keep a warning and its note together when sorting the diagnostics into source location order. llvm-svn: 149669
* Thread safety analysis: at a CFG join point between a block terminating in aRichard Smith2012-02-031-0/+39
| | | | | | | 'continue' and another block, prefer the lockset from the other block, and diagnose the 'continue' block as being the end of a loop. llvm-svn: 149666
* Format string warnings: don't a.k.a. wchar_t with wchar_t.Hans Wennborg2012-01-311-1/+1
| | | | | | | | | | | This fixes the case where Clang would output: error: format specifies type 'wchar_t *' (aka 'wchar_t *') ArgTypeResult::getRepresentativeTypeName needs to take into account that wchar_t can be a built-in type (as opposed to in C, where it is a typedef). llvm-svn: 149387
* [CFG] Removed unused local variable.Erik Verbruggen2012-01-311-2/+0
| | | | llvm-svn: 149385
* Let %S, %ls, %C match 16bit types in NSStrings.Nico Weber2012-01-311-3/+10
| | | | | | As discussed at http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120130/052200.html llvm-svn: 149325
* Fix NSLog format string checking for %@.Ted Kremenek2012-01-252-1/+4
| | | | llvm-svn: 148885
* Teach scanf/printf checking about '%Ld' and friends (a GNU extension). ↵Ted Kremenek2012-01-243-4/+18
| | | | | | Fixes PR 9466. llvm-svn: 148859
* Revert various template unreachability code I committed accidentally.David Blaikie2012-01-241-8/+9
| | | | | | r148774, r148775, r148776, r148777 llvm-svn: 148780
* More fixes/tests.David Blaikie2012-01-241-2/+2
| | | | llvm-svn: 148777
* Support undefined dependent bases.David Blaikie2012-01-241-7/+6
| | | | llvm-svn: 148775
* 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
OpenPOWER on IntegriCloud