summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Rename AnalysisContext to AnalysisDeclContext. Not only is this name more ↵Ted Kremenek2011-10-247-51/+51
| | | | | | accurate, but it frees up the name AnalysisContext for other uses. llvm-svn: 142782
* [analyzer] Remove LocationContext creation methods from AnalysisManager, and ↵Ted Kremenek2011-10-231-5/+23
| | | | | | | | change clients to use AnalysisContext instead. WIP to remove/reduce ExprEngine's usage of AnalysisManager. llvm-svn: 142739
* Refactor ThreadSafety to use PostOrderCFGView instead of its own copy (of ↵Ted Kremenek2011-10-221-83/+7
| | | | | | TopologicallySortedCFG). llvm-svn: 142714
* Pull TopologicallySortedCFG out of LiveVariables into its own analysis: ↵Ted Kremenek2011-10-223-105/+55
| | | | | | PostOrderCFGView. llvm-svn: 142713
* Added support for thread safety attributes on destructors.DeLesley Hutchins2011-10-211-2/+27
| | | | llvm-svn: 142685
* Thread safety analysis refactoring: invalid lock expressions.DeLesley Hutchins2011-10-211-30/+60
| | | | llvm-svn: 142666
* Thread safety analysis: add support for attributes on constructors.DeLesley Hutchins2011-10-211-56/+78
| | | | llvm-svn: 142665
* Refactoring and code cleanup.DeLesley Hutchins2011-10-211-65/+100
| | | | llvm-svn: 142654
* More metaprogramming with builtin types.John McCall2011-10-181-15/+9
| | | | llvm-svn: 142433
* Suggest %zu for size_t args to printf.Hans Wennborg2011-10-181-1/+18
| | | | | | | | For PR11152. Make PrintSpecifier::fixType() suggest "%zu" for size_t, etc. rather than looking at the underlying type and suggesting "%llu" or other platform-specific length modifiers. Applies to C99 and C++11. llvm-svn: 142342
* Substitute for arguments in method calls -- functionalityDeLesley Hutchins2011-10-171-11/+32
| | | | llvm-svn: 142267
* Substitute for arguments in method calls -- refactoringDeLesley Hutchins2011-10-171-64/+98
| | | | llvm-svn: 142260
* Add a new placeholder type to represent "unbridged"John McCall2011-10-171-0/+1
| | | | | | | | casts in ARC. No semantic analysis yet. llvm-svn: 142208
* Provide half floating point support as a storage only type.Anton Korobeynikov2011-10-141-0/+1
| | | | | | Lack of half FP was a regression compared to llvm-gcc. llvm-svn: 142016
* Refactor static analyzer to use simpler interface to constant expression ↵Richard Smith2011-10-141-21/+8
| | | | | | evaluation. llvm-svn: 141983
* Tweak -Wuninitialized's handling of 'int x = x' to report that as the root ↵Ted Kremenek2011-10-131-0/+6
| | | | | | cause of an uninitialized variable IFF there are other uses of that uninitialized variable. Fixes <rdar://problem/9259237>. llvm-svn: 141881
* Remove AnalysisContext::getLiveVariables(), and introduce a templatized ↵Ted Kremenek2011-10-072-14/+24
| | | | | | mechanism to lazily create analyses that are attached to AnalysisContext objects. llvm-svn: 141425
* ProgramPoint cleanup after the previous commit r141408 (remove the copy ↵Anna Zaks2011-10-071-0/+25
| | | | | | | | constructor, mark withTag const). Move getProgramPoint() utility from CoreEngine.cpp into ProgramPoint. llvm-svn: 141414
OpenPOWER on IntegriCloud