This revision was automatically updated to reflect the committed changes.
Closed by commit rG6b85cc18eb7b: [clang][dataflow] Use existing accessors to
check for copy and move assignment… (authored by mboehme).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148612/new/
https://reviews.llvm.org/D148612
Files:
clang/lib/Analysis/FlowSensitive/Transfer.cpp
Index: clang/lib/Analysis/FlowSensitive/Transfer.cpp
===================================================================
--- clang/lib/Analysis/FlowSensitive/Transfer.cpp
+++ clang/lib/Analysis/FlowSensitive/Transfer.cpp
@@ -646,9 +646,12 @@
assert(Arg1 != nullptr);
// Evaluate only copy and move assignment operators.
- auto *Arg0Type = Arg0->getType()->getUnqualifiedDesugaredType();
- auto *Arg1Type = Arg1->getType()->getUnqualifiedDesugaredType();
- if (Arg0Type != Arg1Type)
+ const auto *Method =
+ dyn_cast_or_null<CXXMethodDecl>(S->getDirectCallee());
+ if (!Method)
+ return;
+ if (!Method->isCopyAssignmentOperator() &&
+ !Method->isMoveAssignmentOperator())
return;
auto *ObjectLoc = Env.getStorageLocation(*Arg0, SkipPast::Reference);
Index: clang/lib/Analysis/FlowSensitive/Transfer.cpp
===================================================================
--- clang/lib/Analysis/FlowSensitive/Transfer.cpp
+++ clang/lib/Analysis/FlowSensitive/Transfer.cpp
@@ -646,9 +646,12 @@
assert(Arg1 != nullptr);
// Evaluate only copy and move assignment operators.
- auto *Arg0Type = Arg0->getType()->getUnqualifiedDesugaredType();
- auto *Arg1Type = Arg1->getType()->getUnqualifiedDesugaredType();
- if (Arg0Type != Arg1Type)
+ const auto *Method =
+ dyn_cast_or_null<CXXMethodDecl>(S->getDirectCallee());
+ if (!Method)
+ return;
+ if (!Method->isCopyAssignmentOperator() &&
+ !Method->isMoveAssignmentOperator())
return;
auto *ObjectLoc = Env.getStorageLocation(*Arg0, SkipPast::Reference);
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits