diff options
author | Shuai Wang <shuaiwang@google.com> | 2018-09-11 17:33:12 +0000 |
---|---|---|
committer | Shuai Wang <shuaiwang@google.com> | 2018-09-11 17:33:12 +0000 |
commit | ea85b52732827eb41913a1cd60ae66b56e99de82 (patch) | |
tree | e8194ea63bd5467b25dab569aca01a721bdc9a9c /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | aca532f14dd3360d0025e0b9d5ae606be046cf79 (diff) | |
download | llvm-ea85b52732827eb41913a1cd60ae66b56e99de82.zip llvm-ea85b52732827eb41913a1cd60ae66b56e99de82.tar.gz llvm-ea85b52732827eb41913a1cd60ae66b56e99de82.tar.bz2 |
[clang-tidy] Handle unique owning smart pointers in ExprMutationAnalyzer
Summary:
For smart pointers like std::unique_ptr which uniquely owns the
underlying object, treat the mutation of the pointee as mutation of the
smart pointer itself.
This gives better behavior for cases like this:
```
void f(std::vector<std::unique_ptr<Foo>> v) { // undesirable analyze result of `v` as not mutated.
for (auto& p : v) {
p->mutate(); // only const member function `operator->` is invoked on `p`
}
}
```
Reviewers: hokein, george.karpenkov
Subscribers: xazax.hun, a.sidorin, Szelethus, cfe-commits
Differential Revision: https://reviews.llvm.org/D50883
llvm-svn: 341967
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
0 files changed, 0 insertions, 0 deletions