================
@@ -269,6 +473,21 @@ void BranchCloneCheck::check(const 
MatchFinder::MatchResult &Result) {
     return;
   }
 
+  if (const auto *IS = Result.Nodes.getNodeAs<IfStmt>("ifWithDescendantIf")) {
+    const Stmt *Then = IS->getThen();
+    auto CS = dyn_cast<CompoundStmt>(Then);
+    if (CS && (!CS->body_empty())) {
+      const auto *InnerIf = dyn_cast<IfStmt>(*CS->body_begin());
+      if (InnerIf && isIdenticalStmt(Context, IS->getCond(), 
InnerIf->getCond(),
+                                     /*IgnoreSideEffects=*/false)) {
----------------
HerrCai0907 wrote:

I mean we can do this check in ast_matcher to reduce the cost

https://github.com/llvm/llvm-project/pull/114715
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to