================
@@ -4278,25 +4276,21 @@ class DecompositionDecl final
   // Provide a flattened range to visit each binding.
   auto flat_bindings() const {
     llvm::ArrayRef<BindingDecl *> Bindings = bindings();
-    llvm::ArrayRef<Expr *> PackExprs;
+    llvm::ArrayRef<BindingDecl *> PackBindings;
 
     // Split the bindings into subranges split by the pack.
-    auto S1 = Bindings.take_until(
+    auto BeforePackBindings = Bindings.take_until(
         [](BindingDecl *BD) { return BD->isParameterPack(); });
 
-    Bindings = Bindings.drop_front(S1.size());
+    Bindings = Bindings.drop_front(BeforePackBindings.size());
     if (!Bindings.empty()) {
-      PackExprs = Bindings.front()->getBindingPackExprs();
+      PackBindings = Bindings.front()->getBindingPackDecls();
       Bindings = Bindings.drop_front();
     }
 
-    auto S2 = llvm::map_range(PackExprs, [](Expr *E) {
-      auto *DRE = cast<DeclRefExpr>(E);
-      return cast<BindingDecl>(DRE->getDecl());
-    });
-
-    return llvm::concat<BindingDecl *>(std::move(S1), std::move(S2),
-                                       std::move(Bindings));
+    return llvm::concat<BindingDecl *const>(std::move(BeforePackBindings),
----------------
erichkeane wrote:

I realize you're taking from the previous patch, but these `std::move` calls 
are a little silly :)  All of the types are an `ArrayRef`, so there is nothing 
to steal.

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

Reply via email to