summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
...
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-112-2/+2
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Replace a map of boolean values with a set.Benjamin Kramer2012-03-101-14/+8
| | | | | | No functionality change. llvm-svn: 152494
* Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr toJohn McCall2012-03-103-28/+11
| | | | | | | | track whether the referenced declaration comes from an enclosing local context. I'm amenable to suggestions about the exact meaning of this bit. llvm-svn: 152491
* [analyzer] fix regression in analyzer of NOT actually aborting on Stmts it ↵Ted Kremenek2012-03-101-1/+10
| | | | | | | | | | | doesn't understand. We registered as aborted, but didn't treat such cases as sinks in the ExplodedGraph. Along the way, add basic support for CXXCatchStmt, expanding the set of code we actually analyze (hopefully correctly). Fixes: <rdar://problem/10892489> llvm-svn: 152468
* CallGraph: Add getNode() method, constify.Anna Zaks2012-03-091-0/+4
| | | | llvm-svn: 152439
* -Wformat-non-iso: warn about positional arguments (pr12017)Hans Wennborg2012-03-091-0/+3
| | | | | | | | | This renames the -Wformat-non-standard flag to -Wformat-non-iso, rewords the current warnings a bit (pointing out that a format string is not supported by ISO C rather than being "non standard"), and adds a warning about positional arguments. llvm-svn: 152403
* Call Graph: Only the root node is allowed to have an invalid Decl*.Anna Zaks2012-03-081-1/+4
| | | | llvm-svn: 152350
* Remove stray semi-colon.Daniel Dunbar2012-03-081-1/+1
| | | | llvm-svn: 152331
* Add a basic CallGraph to Analysis.Anna Zaks2012-03-082-0/+208
| | | | | | | | | | The final graph contains a single root node, which is a parent of all externally available functions(and 'main'). As well as a list of Parentless/Unreachable functions, which are either truly unreachable or are unreachable due to our analyses imprecision. The analyzer checkers debug.DumpCallGraph or debug.ViewGraph can be used to look at the produced graph. Currently, the graph is not very precise, for example, it entirely skips edges resulted from ObjC method calls. llvm-svn: 152272
* AST representation for user-defined literals, plus just enough of semanticRichard Smith2012-03-071-0/+1
| | | | | | | | | | | | | | | | | | | | | analysis to make the AST representation testable. They are represented by a new UserDefinedLiteral AST node, which is a sugared CallExpr. All semantic properties, including full CodeGen support, are achieved for free by this representation. UserDefinedLiterals can never be dependent, so no custom instantiation behavior is required. They are mangled as if they were direct calls to the underlying literal operator. This matches g++'s apparent behavior (but not its actual mangling, which is broken for literal-operator-ids). User-defined *string* literals are now fully-operational, but the semantic analysis is quite hacky and needs more work. No other forms of user-defined literal are created yet, but the AST support for them is present. This patch committed after midnight because we had already hit the quota for new kinds of literal yesterday. llvm-svn: 152211
* 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
OpenPOWER on IntegriCloud