summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/ExprMutationAnalyzer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] handle modification of vars inside an expr with comma operatorPetar Jovanovic2019-03-071-13/+33
| | | | | | | | | | | | | | | | | We should track mutation of a variable within a comma operator expression. Current code in ExprMutationAnalyzer does not handle it. This will handle cases like: (a, b) ++ < == b is modified (a, b) = c < == b is modifed Patch by Djordje Todorovic. Differential Revision: https://reviews.llvm.org/D58894 llvm-svn: 355605
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [analyzer] Fix nullptr access when processing instantiated function in ↵Shuai Wang2018-09-191-1/+1
| | | | | | ExprMutationAnalyzer. llvm-svn: 342562
* [analyzer] Treat std::{move,forward} as casts in ExprMutationAnalyzer.Shuai Wang2018-09-171-2/+13
| | | | | | | | | | | | | | | Summary: This is a follow up of D52008 and should make the analyzer being able to handle perfect forwardings in real world cases where forwardings are done through multiple layers of function calls with `std::forward`. Fixes PR38891. Reviewers: lebedev.ri, JonasToth, george.karpenkov Subscribers: xazax.hun, szepet, a.sidorin, mikhail.ramalho, Szelethus, cfe-commits Differential Revision: https://reviews.llvm.org/D52120 llvm-svn: 342409
* [NFC] Minor refactoring to setup the stage for supporting pointers in ↵Shuai Wang2018-09-161-43/+86
| | | | | | ExprMutationAnalyzer llvm-svn: 342353
* [NFC] cosmetic tweaks to ExprMutationAnalyzer to be more consistentShuai Wang2018-09-151-13/+12
| | | | | | especially considering future changes. llvm-svn: 342340
* [analyzer] Handle forwarding reference better in ExprMutationAnalyzer.Shuai Wang2018-09-141-2/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We used to treat an `Expr` mutated whenever it's passed as non-const reference argument to a function. This results in false positives in cases like this: ``` int x; std::vector<int> v; v.emplace_back(x); // `x` is passed as non-const reference to `emplace_back` ``` In theory the false positives can be suppressed with `v.emplace_back(std::as_const(x))` but that's considered overly verbose, inconsistent with existing code and spammy as diags. This diff handles such cases by following into the function definition and see whether the argument is mutated inside. Reviewers: lebedev.ri, JonasToth, george.karpenkov Subscribers: xazax.hun, szepet, a.sidorin, mikhail.ramalho, Szelethus, cfe-commits Differential Revision: https://reviews.llvm.org/D52008 llvm-svn: 342271
* [analyzer] Add ExprMutationAnalyzerShuai Wang2018-09-111-0/+308
Summary: This is 1/2 of moving ExprMutationAnalyzer from clangtidy to clang/Analysis. This diff along simply copies the ExprMutationAnalyzer over with trivial modifications (e.g. include path, namespace) 2/2 will migrate existing usage of ExprMutationAnalyzer and remove the original copy inside clangtidy. Reviewers: george.karpenkov Subscribers: mgorny, xazax.hun, szepet, a.sidorin, mikhail.ramalho, Szelethus, cfe-commits, JonasToth Differential Revision: https://reviews.llvm.org/D51948 llvm-svn: 341994
OpenPOWER on IntegriCloud