summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer
Commit message (Collapse)AuthorAgeFilesLines
...
* [C++11] Replacing ObjCProtocolDecl iterators protocol_begin() and ↵Aaron Ballman2014-03-131-4/+2
| | | | | | protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203863
* [C++11] Replacing ObjCInterfaceDecl iterators visible_extensions_begin() and ↵Aaron Ballman2014-03-131-6/+2
| | | | | | visible_extensions_end() with iterator_range visible_extensions(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203855
* [C++11] Replacing ObjCInterfaceDecl iterators visible_categories_begin() and ↵Aaron Ballman2014-03-131-4/+1
| | | | | | visible_categories_end() with iterator_range visible_categories(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203851
* [C++11] Replacing ObjCInterfaceDecl iterators ivar_begin() and ivar_end() ↵Aaron Ballman2014-03-132-17/+10
| | | | | | with iterator_range ivars(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203849
* [C++11] Replacing ObjCInterfaceDecl iterators protocol_begin() and ↵Aaron Ballman2014-03-131-8/+5
| | | | | | | | protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops. Drive-by fixing some incorrect types where a for loop would be improperly using ObjCInterfaceDecl::protocol_iterator. No functional changes in these cases. llvm-svn: 203842
* [C++11] Replacing ObjCContainerDecl iterators instmeth_begin() and ↵Aaron Ballman2014-03-135-27/+11
| | | | | | instmeth_end() with iterator_range instance_methods(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203839
* Renaming the recently-created (r203830) props() range API to properties() ↵Aaron Ballman2014-03-131-1/+1
| | | | | | for clarity. llvm-svn: 203835
* [C++11] Replacing ObjCContainerDecl iterators meth_begin() and meth_end() ↵Aaron Ballman2014-03-131-8/+4
| | | | | | with iterator_range methods(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203832
* [C++11] Replacing ObjCContainerDecl iterators prop_begin() and prop_end() ↵Aaron Ballman2014-03-131-4/+1
| | | | | | with iterator_range props(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203830
* [analyzer] Warn when passing pointers to const but uninitialized memory.Jordan Rose2014-03-132-23/+113
| | | | | | | | | | | | | | | | | Passing a pointer to an uninitialized memory buffer is normally okay, but if the function is declared to take a pointer-to-const then it's very unlikely it will be modifying the buffer. In this case the analyzer should warn that there will likely be a read of uninitialized memory. This doesn't check all elements of an array, only the first one. It also doesn't yet check Objective-C methods, only C functions and C++ methods. This is controlled by a new check: alpha.core.CallAndMessageUnInitRefArg. Patch by Per Viberg! llvm-svn: 203822
* [C++11] Replacing CXXRecordDecl iterators ctor_begin() and ctor_end() with ↵Aaron Ballman2014-03-131-2/+1
| | | | | | iterator_range ctors(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203814
* [C++11] Replacing CXXRecordDecl iterators bases_begin() and bases_end() with ↵Aaron Ballman2014-03-132-11/+5
| | | | | | iterator_range bases(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203803
* [analyzer] Check all conditions in a chained if against each other.Jordan Rose2014-03-111-0/+24
| | | | | | | | | | | | Like the binary operator check of r201702, this actually checks the condition of every if in a chain against every other condition, an O(N^2) operation. In most cases N should be small enough to make this practical, and checking all cases like this makes it much more likely to catch a copy-paste error within the same series of branches. Part of IdenticalExprChecker; patch by Daniel Fahlgren! llvm-svn: 203585
* [analyzer] Eliminate memory leak in BugReporter::emitReport()Anton Yartsev2014-03-101-2/+5
| | | | llvm-svn: 203507
* [C++11] Avoid implicit conversion of ArrayRef to std::vector and use move ↵Benjamin Kramer2014-03-101-4/+2
| | | | | | semantics where appropriate. llvm-svn: 203477
* [C++11] Replacing DeclBase iterators specific_attr_begin() and ↵Aaron Ballman2014-03-104-38/+13
| | | | | | specific_attr_end() with iterator_range specific_attrs(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203474
* [C++11] Replace OwningPtr include with <memory>.Ahmed Charles2014-03-093-3/+3
| | | | llvm-svn: 203389
* [C++11] Replacing RecordDecl iterators field_begin() and field_end() with ↵Aaron Ballman2014-03-085-20/+13
| | | | | | iterator_range fields(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203355
* [C++11] Revert uses of lambdas with array_pod_sort.Benjamin Kramer2014-03-071-5/+6
| | | | | | Looks like GCC implements the lambda->function pointer conversion differently. llvm-svn: 203293
* [C++11] Convert sort predicates into lambdas.Benjamin Kramer2014-03-071-6/+5
| | | | | | No functionality change. llvm-svn: 203289
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-0744-113/+110
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* [C++11] Replacing DeclBase iterators decls_begin() and decls_end() with ↵Aaron Ballman2014-03-071-3/+2
| | | | | | iterator_range decls(). The same is true for the noload versions of these APIs. Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203278
* Change OwningPtr::take() to OwningPtr::release().Ahmed Charles2014-03-074-5/+5
| | | | | | This is a precursor to moving to std::unique_ptr. llvm-svn: 203275
* [C++11] Replacing ObjCMethodDecl iterators param_begin() and param_end() ↵Aaron Ballman2014-03-071-3/+2
| | | | | | with iterator_range params(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203255
* [C++11] Replacing FunctionDecl iterators param_begin() and param_end() with ↵Aaron Ballman2014-03-071-3/+2
| | | | | | iterator_range params(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203248
* Added an inserter for ArrayRef<SourceRange>.Alexander Kornienko2014-03-061-12/+4
| | | | | | | | | | | | | | Summary: Added an inserter for ArrayRef<SourceRange>, as it is already needed in at least two places (static analyzer and clang-tidy). Reviewers: jordan_rose CC: cfe-commits, gribozavr Differential Revision: http://llvm-reviews.chandlerc.com/D2984 llvm-svn: 203117
* Remove dead return in BugReporter (found via -Wunreachable-code).Ted Kremenek2014-03-061-4/+2
| | | | llvm-svn: 203077
* [C++11] Simplify compare operators with std::tie.Benjamin Kramer2014-03-031-2/+1
| | | | | | No functionality change. llvm-svn: 202755
* [C++11] Replace llvm::tie with std::tie.Benjamin Kramer2014-03-0225-60/+58
| | | | llvm-svn: 202639
* [C++11] Replace llvm::next and llvm::prior with std::next and std::prev.Benjamin Kramer2014-03-021-1/+1
| | | | llvm-svn: 202635
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-021-1/+1
| | | | llvm-svn: 202625
* [C++11] Switch from the llvm_move macro to directly calling std::move.Chandler Carruth2014-03-021-2/+2
| | | | llvm-svn: 202611
* [C++11] Replace verbose functors with succinct lambdasBenjamin Kramer2014-03-011-13/+5
| | | | | | No functionality change. llvm-svn: 202590
* [analyzer] Fix for PR18394.Anton Yartsev2014-02-281-2/+7
| | | | | | Additional conditions that prevent useful nodes before call from being reclaimed. llvm-svn: 202553
* [analyzer] check for now possibly null predecessor edge.Ted Kremenek2014-02-271-0/+5
| | | | llvm-svn: 202434
* [OPENMP] First changes for Parsing and Sema for 'omp simd' directive supportAlexey Bataev2014-02-271-0/+1
| | | | llvm-svn: 202360
* [CMake] Use LINK_LIBS instead of target_link_libraries().NAKAMURA Takumi2014-02-263-6/+3
| | | | llvm-svn: 202238
* [analyzer] NonNullParamChecker: don't freak out about nested transparent_unions.Jordan Rose2014-02-261-1/+3
| | | | | | | | | For now, just ignore them. Later, we could try looking through LazyCompoundVals, but we at least shouldn't crash. <rdar://problem/16153464> llvm-svn: 202212
* Update for llvm api change.Rafael Espindola2014-02-241-1/+1
| | | | llvm-svn: 202053
* Don't assume that F_None is the default. It is about to change.Rafael Espindola2014-02-241-1/+1
| | | | llvm-svn: 202040
* [CMake] Get rid of explicit dependencies to include/clang/*.inc and ↵NAKAMURA Takumi2014-02-213-27/+1
| | | | | | | | | | | | | | | | | | | introduce CLANG_TABLEGEN_TARGETS. This does; - clang_tablegen() adds each tblgen'd target to global property CLANG_TABLEGEN_TARGETS as list. - List of targets is added to LLVM_COMMON_DEPENDS. - all clang libraries and targets depend on generated headers. You might wonder this would be regression, but in fact, this is little loss. - Almost all of clang libraries depend on tblgen'd files and clang-tblgen. - clang-tblgen may cause short stall-out but doesn't cause unconditional rebuild. - Each library's dependencies to tblgen'd files might vary along headers' structure. It made hard to track and update *really optimal* dependencies. Each dependency to intrinsics_gen and ClangSACheckers is left as DEPENDS. llvm-svn: 201842
* [analyzer] Fix a bug in IdenticalExprChecker concerning while loops.Jordan Rose2014-02-211-2/+7
| | | | | | | | | Somehow both Daniel and I missed the fact that while loops are only identical if they have identical bodies. Patch by Daniel Fahlgren! llvm-svn: 201829
* Use llvm::DeleteContainerSeconds when possibleReid Kleckner2014-02-192-8/+2
| | | | llvm-svn: 201739
* [analyzer] Extend IdenticalExprChecker to check logical and bitwise expressions.Jordan Rose2014-02-191-12/+75
| | | | | | | | | | | IdenticalExprChecker now warns if any expressions in a logical or bitwise chain (&&, ||, &, |, or ^) are the same. Unlike the previous patch, this actually checks all subexpressions against each other (an O(N^2) operation, but N is likely to be small). Patch by Daniel Fahlgren! llvm-svn: 201702
* [analyzer] Extend IdenticalExprChecker to check the two branches of an if.Jordan Rose2014-02-191-51/+188
| | | | | | | | | | | | | | | This extends the checks for identical expressions to handle identical statements, and compares the consequent and alternative ("then" and "else") branches of an if-statement to see if they are identical, treating a single statement surrounded by braces as equivalent to one without braces. This does /not/ check subsequent branches in an if/else chain, let alone branches that are not consecutive. This may improve in a future patch, but it would certainly take more work. Patch by Daniel Fahlgren! llvm-svn: 201701
* [analyzer] Move checker alpha.osx.cocoa.MissingSuperCall out of alpha category.Ted Kremenek2014-02-191-4/+4
| | | | llvm-svn: 201640
* [analyzer] Teach CastSizeChecker about flexible array members.Jordan Rose2014-02-181-12/+72
| | | | | | | | | ...as well as fake flexible array members: structs that end in arrays with length 0 or 1. Patch by Daniel Fahlgren! llvm-svn: 201583
* [analyzer] Improved checker naming in CFG dump.Anton Yartsev2014-02-178-28/+46
| | | | | | This implements FIXME from Checker.cpp (FIXME: We want to return the package + name of the checker here.) and replaces hardcoded checker names with the new ones obtained via getCheckName().getName(). llvm-svn: 201525
* Use simpler version of llvm::sys::fs::create_directories.Rafael Espindola2014-02-131-3/+1
| | | | llvm-svn: 201290
* Expose the name of the checker producing each diagnostic message.Alexander Kornienko2014-02-1163-438/+567
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In clang-tidy we'd like to know the name of the checker producing each diagnostic message. PathDiagnostic has BugType and Category fields, which are both arbitrary human-readable strings, but we need to know the exact name of the checker in the form that can be used in the CheckersControlList option to enable/disable the specific checker. This patch adds the CheckName field to the CheckerBase class, and sets it in the CheckerManager::registerChecker() method, which gets them from the CheckerRegistry. Checkers that implement multiple checks have to store the names of each check in the respective registerXXXChecker method. Reviewers: jordan_rose, krememek Reviewed By: jordan_rose CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2557 llvm-svn: 201186
OpenPOWER on IntegriCloud