summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
...
* Thread Safety Analysis: add new node types to thread safety TIL.DeLesley Hutchins2014-05-153-97/+192
| | | | | | This fills in a few missing gaps in functionality. llvm-svn: 208830
* Converting some for loops to use range-based for loops. No functional ↵Aaron Ballman2014-05-141-23/+14
| | | | | | changes intended. llvm-svn: 208810
* Amending r208783 based on a suggestion by David Blaikie.Aaron Ballman2014-05-141-14/+12
| | | | llvm-svn: 208800
* Replacing some manual iterations with standard algorithms. No functional ↵Aaron Ballman2014-05-141-29/+22
| | | | | | changes intended. llvm-svn: 208783
* Formatting and style changes; no functional changes intended.Aaron Ballman2014-05-141-8/+7
| | | | llvm-svn: 208774
* Amending r208439 to remove buildLExpr; this code isn't strictly required ↵Aaron Ballman2014-05-091-46/+0
| | | | | | yet, and fixes a dead code warning. llvm-svn: 208440
* Add the ability to use logical expressions for capability attributes. This ↵Aaron Ballman2014-05-093-1/+161
| | | | | | | | | | is to allow requirements to be expressed not just in terms of lists, but in terms of logical expressions. Eg) void foo(void) __attribute__((requires_capability((FlightControl || Worker) && !Logger))); This is WIP code. llvm-svn: 208439
* ThreadSafetyAnalysis: Don't crash when trying to analyze objc methods.Benjamin Kramer2014-05-091-4/+6
| | | | | | | | | | | The thread safety analysis isn't very useful in ObjC (you can't annotate ObjC classes or methods) but we can still analyze the actual code and show violations in usage of C/C++ functions. Fixes PR19541, which does not use thread safety attributes but crashes with -Weverything. llvm-svn: 208436
* Explicitly keep track of temporaries during the consumed analysis.Manuel Klimek2014-05-081-4/+3
| | | | | | | This makes the consumed analysis less dependent on the CFG layout and fixes a bug where we wouldn't warn on an unconsumed value. llvm-svn: 208300
* Fix handling of condition variables in the face of temp dtors.Manuel Klimek2014-05-051-8/+5
| | | | | | | | The assignment needs to be before the destruction of the temporary. This patch calls out to addStmt, which invokes VisitDeclStmt, which has all the correct logic for handling temporaries. llvm-svn: 207985
* Remove unused typedef found by gcc's -Wunused-local-typedefs.Nico Weber2014-05-021-2/+0
| | | | llvm-svn: 207870
* Fix bad comment from r207573.Hans Wennborg2014-05-021-1/+1
| | | | llvm-svn: 207854
* Updated the attribute tablegen emitter for variadic arguments to emit a ↵Aaron Ballman2014-05-022-25/+16
| | | | | | range accessor in addition to the iterators. Updated code using iterators to use range-based for loops. llvm-svn: 207837
* Renaming the CallableState variadic attribute argument to be CallableStates. ↵Aaron Ballman2014-05-021-2/+2
| | | | | | No functional changes intended. llvm-svn: 207836
* scanf analysis: handle scanlists that start with ^] (PR19559)Hans Wennborg2014-04-291-0/+9
| | | | llvm-svn: 207573
* Renaming range-based for loop variables so they don't appear iterator-like.Aaron Ballman2014-04-281-23/+23
| | | | llvm-svn: 207422
* [C++11] Converting to range-based for loops. No functional changes intended.Aaron Ballman2014-04-281-46/+27
| | | | llvm-svn: 207416
* Replacing a naked pointer with a unique_ptr. No functional changes intended.Aaron Ballman2014-04-231-3/+3
| | | | llvm-svn: 206986
* Updated to be a bit more const friendly. Also switched the linkage to be ↵Aaron Ballman2014-04-231-3/+3
| | | | | | static since this function is file-local. No functional changes intended. llvm-svn: 206982
* Thread safety analysis: add array operations to SExpr.DeLesley Hutchins2014-04-221-1/+4
| | | | llvm-svn: 206907
* Thread safety analysis: fix warning.DeLesley Hutchins2014-04-221-2/+1
| | | | llvm-svn: 206899
* [Modules] Fix potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2014-04-221-2/+2
| | | | | | | | | | definition below all of the header #include lines, clang edition. If you want more details about this, you can see some of the commits to Debug.h in LLVM recently. This is just the clang section of a cleanup I've done for all uses of DEBUG_TYPE in LLVM. llvm-svn: 206849
* Thread safety analysis: misc updates to SExpr handling. Fix to minimal SSA,DeLesley Hutchins2014-04-211-39/+85
| | | | | | function parameters, and compound assignment. llvm-svn: 206827
* Thread Safety Analysis: Convert to minimal SSA.DeLesley Hutchins2014-04-191-17/+72
| | | | llvm-svn: 206681
* Thread Safety Analysis: Update SSA pass to handle loops.DeLesley Hutchins2014-04-191-85/+169
| | | | llvm-svn: 206676
* Updating to use more range-based for loops, nullptr and auto. No functional ↵Aaron Ballman2014-04-181-20/+14
| | | | | | changes. llvm-svn: 206590
* Making some public members into private members. This also introduces a bit ↵Aaron Ballman2014-04-171-16/+10
| | | | | | more const-correctness, and now uses some range-based for loops. No functional changes intended. llvm-svn: 206503
* Since the object is new'ed in the enterCFG function, now deleting in the ↵Aaron Ballman2014-04-171-0/+1
| | | | | | exitCFG function instead of the destructor to ensure proper pairing. This allows reuse of the builder without creating a memory leak. llvm-svn: 206471
* -Wunreachable-code: refine recognition of unreachable "sigil" to cope with ↵Ted Kremenek2014-04-161-1/+4
| | | | | | | | implicit casts in C++. Fixes <rdar://problem/16631033>. llvm-svn: 206360
* Thread Safety Analysis: rewrite SSA pass to use the new SExpr and CFGDeLesley Hutchins2014-04-151-89/+296
| | | | | | | traversal system. The new pass is still undergoing testing; no change in functionality. llvm-svn: 206338
* Fix typo from r206232Richard Trieu2014-04-151-2/+2
| | | | llvm-svn: 206234
* Fix a bad interaction between -Wtautological-overlap-compare and delayedRichard Trieu2014-04-151-0/+6
| | | | | | diagnostics which caused delayed diagnostics on dead paths to be emitted. llvm-svn: 206232
* Thread Safety Analysis: reorganized SExpr header files. No change inDeLesley Hutchins2014-04-092-0/+9
| | | | | | functionality. llvm-svn: 205936
* Thread Safety Analysis: now with less includes. No functional changes.Aaron Ballman2014-04-091-1/+1
| | | | llvm-svn: 205929
* Thread Safety Analysis: some minor cleanups to the latest thread safety ↵Aaron Ballman2014-04-091-44/+34
| | | | | | | | | | | | changes. No functional changes intended. * Adds an iterator_range interface to CallExpr to get the arguments * Modifies SExpr such that it must be allocated in the Arena, and cannot be deleted * Minor const-correctness and nullptr updates * Adds some operator!= implementations to complement operator== * Removes unused functionality llvm-svn: 205915
* Thread Safety Analysis. Misc fixes to SExpr code, responding to code reviewDeLesley Hutchins2014-04-081-8/+2
| | | | | | by Aaron Ballman. llvm-svn: 205809
* Thread Safety Analysis: various fixes to new SExpr code.DeLesley Hutchins2014-04-071-20/+34
| | | | | | Implemented ownership policy, updated to use nullptr, const-cleanup. llvm-svn: 205745
* Thread Safety Analysis: update to internal SExpr handling.DeLesley Hutchins2014-04-073-8/+423
| | | | | | | | | | This patch is the first part of a significant refactoring that seeks to restore sanity to way thread safety analysis deals with capability expressions. The current patch merely provides an outline of the structure of the new system. It's not yet connected to the actual analysis, so there's no change in functionality. llvm-svn: 205728
* Add a new subgroup to -Wtautological-compare, -Wtautological-overlap-compare,Richard Trieu2014-04-051-0/+223
| | | | | | | | | | | | | | which warns on compound conditionals that always evaluate to the same value. For instance, (x > 5 && x < 3) will always be false since no value for x can satisfy both conditions. This patch also changes the CFG to use these tautological values for better branch analysis. The test for -Wunreachable-code shows how this change catches additional dead code. Patch by Anders Rönnholm. llvm-svn: 205665
* Updating the capability attribute diagnostics to be more capability-neutral. ↵Aaron Ballman2014-04-011-104/+176
| | | | | | Instead of using terminology such as "lock", "unlock" and "locked", the new terminology is "acquire", "release" and "held". Additionally, the capability attribute's name argument is now reported as part of the diagnostic, instead of hard coding as "mutex." llvm-svn: 205359
* [analyzer] Fix a CFG printing bug.Jordan Rose2014-04-011-0/+2
| | | | | | | | | Also, add several destructor-related tests. Most of them don't work yet, but it's good to have them recorded. Patch by Alex McCarthy! llvm-svn: 205326
* [-Wunreachable-code] Expand paren-suppression heuristic to C++/ObjC bools.Ted Kremenek2014-03-291-6/+11
| | | | llvm-svn: 205074
* Improve -Wunreachable-code to provide a means to indicate code is ↵Ted Kremenek2014-03-292-15/+52
| | | | | | | | | | | | | | | | | | intentionally marked dead via if((0)). Taking a hint from -Wparentheses, use an extra '()' as a sigil that a dead condition is intentionally dead. For example: if ((0)) { dead } When this sigil is found, do not emit a dead code warning. When the analysis sees: if (0) it suggests inserting '()' as a Fix-It. llvm-svn: 205069
* remove a bunch of unused private methodsNuno Lopes2014-03-232-19/+0
| | | | | | | | | | | | | | | | | | found with a smarter version of -Wunused-member-function that I'm playwing with. Appologies in advance if I removed someone's WIP code. ARCMigrate/TransProperties.cpp | 8 ----- AST/MicrosoftMangle.cpp | 1 Analysis/AnalysisDeclContext.cpp | 5 --- Analysis/LiveVariables.cpp | 14 ---------- Index/USRGeneration.cpp | 10 ------- Sema/Sema.cpp | 33 +++++++++++++++++++++--- Sema/SemaChecking.cpp | 3 -- Sema/SemaDecl.cpp | 20 ++------------ StaticAnalyzer/Checkers/GenericTaintChecker.cpp | 1 9 files changed, 34 insertions(+), 61 deletions(-) llvm-svn: 204561
* The release_capability, release_shared_capability and ↵Aaron Ballman2014-03-211-27/+33
| | | | | | release_generic_capability functions are now functionally distinct for capability analysis. The unlock_function attribute maps directly to release_generic_capability. llvm-svn: 204469
* [-Wunreachable-code] add a specialized diagnostic for unreachable increment ↵Ted Kremenek2014-03-211-0/+20
| | | | | | expressions of loops. llvm-svn: 204430
* Consumed Analysis: IgnoreParens bugfix.DeLesley Hutchins2014-03-201-29/+38
| | | | llvm-svn: 204395
* [-Wunreachable-code] Tweak isTrivialDoWhile() to handle implicit casts.Ted Kremenek2014-03-201-1/+1
| | | | llvm-svn: 204376
* Replacing the exclusive_lock_function, shared_lock_function and ↵Aaron Ballman2014-03-201-24/+14
| | | | | | | | unlock_function attributes with the acquire_capability and release_capability attributes. The old spellings will continue to work, but the underlying semantic attributes have been replaced. Downgraded the capability diagnostics from error to warning to match the desired behavior, and updated the existing test cases. llvm-svn: 204350
* [-Wunreachable-code] Look through member accesses for 'static const bool' ↵Ted Kremenek2014-03-201-23/+27
| | | | | | configuration values. llvm-svn: 204315
OpenPOWER on IntegriCloud