[PATCH] D141814: [llvm][ADT] Replace uses of `makeMutableArrayRef` with deduction guides
jloser added inline comments. Comment at: lldb/source/Host/common/NativeProcessProtocol.cpp:652 auto data = + llvm::MutableArrayRef(static_cast(buf), bytes_read); serge-sans-paille wrote: > random nit: This could be rewritten as > > ``` > llvm::MutableArrayRef data(static_cast(buf), bytes_read); > ``` > > now Yep, I just changed that before landing this. Thanks for the review! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141814/new/ https://reviews.llvm.org/D141814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D141814: [llvm][ADT] Replace uses of `makeMutableArrayRef` with deduction guides
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGa288d7f93770: [llvm][ADT] Replace uses of `makeMutableArrayRef` with deduction guides (authored by jloser). Changed prior to commit: https://reviews.llvm.org/D141814?vs=489419=489635#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141814/new/ https://reviews.llvm.org/D141814 Files: bolt/lib/Profile/DataAggregator.cpp clang-tools-extra/clangd/FuzzyMatch.cpp clang-tools-extra/clangd/SemanticSelection.cpp clang-tools-extra/clangd/index/dex/Trigram.cpp clang-tools-extra/pseudo/include/clang-pseudo/Forest.h clang/include/clang/AST/DeclOpenMP.h clang/include/clang/AST/OpenMPClause.h clang/include/clang/AST/StmtOpenMP.h clang/include/clang/Lex/MacroInfo.h clang/lib/AST/StmtOpenMP.cpp lld/COFF/Chunks.cpp lld/COFF/DebugTypes.cpp lld/COFF/Writer.cpp lld/ELF/InputFiles.h lld/ELF/SyntheticSections.cpp lldb/source/Host/common/NativeProcessProtocol.cpp llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h llvm/include/llvm/IR/DataLayout.h llvm/include/llvm/IR/Metadata.h llvm/include/llvm/ProfileData/InstrProf.h llvm/include/llvm/Support/Parallel.h llvm/lib/Analysis/ConstantFolding.cpp llvm/lib/ExecutionEngine/ExecutionEngine.cpp llvm/lib/Support/Path.cpp llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp llvm/lib/Transforms/Scalar/IndVarSimplify.cpp llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp llvm/unittests/Support/Path.cpp mlir/lib/Bytecode/Writer/IRNumbering.cpp mlir/lib/Dialect/Affine/Transforms/LoopCoalescing.cpp mlir/test/mlir-tblgen/constraint-unique.td mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp Index: mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp === --- mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp +++ mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp @@ -2746,7 +2746,7 @@ /// /// {0}: The region's index. const char *const getSingleRegion = - "::llvm::makeMutableArrayRef((*this)->getRegion({0}))"; + "::llvm::MutableArrayRef((*this)->getRegion({0}))"; // If we have no regions, there is nothing more to do. const auto canSkip = [](const NamedRegion ) { @@ -2781,7 +2781,7 @@ /// Get a single successor. /// /// {0}: The successor's name. - const char *const getSingleSuccessor = "::llvm::makeMutableArrayRef({0}())"; + const char *const getSingleSuccessor = "::llvm::MutableArrayRef({0}())"; // If we have no successors, there is nothing more to do. const auto canSkip = [](const NamedSuccessor ) { Index: mlir/test/mlir-tblgen/constraint-unique.td === --- mlir/test/mlir-tblgen/constraint-unique.td +++ mlir/test/mlir-tblgen/constraint-unique.td @@ -127,10 +127,10 @@ // CHECK: for (auto [[$RET_VALUE:.*]] : [[$RET_VALUE_GROUP]]) // CHECK-NEXT: if (::mlir::failed([[$A_TYPE_CONSTRAINT]](*this, [[$RET_VALUE]].getType(), "result", index++))) // CHECK-NEXT:return ::mlir::failure(); -// CHECK: for (auto : ::llvm::makeMutableArrayRef((*this)->getRegion(0))) +// CHECK: for (auto : ::llvm::MutableArrayRef((*this)->getRegion(0))) // CHECK-NEXT: if (::mlir::failed([[$A_REGION_CONSTRAINT]](*this, region, "d", index++))) // CHECK-NEXT:return ::mlir::failure(); -// CHECK: for (auto *successor : ::llvm::makeMutableArrayRef(c())) +// CHECK: for (auto *successor : ::llvm::MutableArrayRef(c())) // CHECK-NEXT: if (::mlir::failed([[$A_SUCCESSOR_CONSTRAINT]](*this, successor, "c", index++))) // CHECK-NEXT:return ::mlir::failure(); @@ -148,9 +148,9 @@ // CHECK: for (auto [[$RET_VALUE:.*]] : [[$RET_VALUE_GROUP]]) // CHECK-NEXT: if (::mlir::failed([[$O_TYPE_CONSTRAINT]](*this, [[$RET_VALUE]].getType(), "result", index++))) // CHECK-NEXT:return ::mlir::failure(); -// CHECK: for (auto : ::llvm::makeMutableArrayRef((*this)->getRegion(0))) +// CHECK: for (auto : ::llvm::MutableArrayRef((*this)->getRegion(0))) // CHECK-NEXT: if (::mlir::failed([[$O_REGION_CONSTRAINT]](*this, region, "d", index++))) // CHECK-NEXT:return ::mlir::failure(); -// CHECK: for (auto *successor : ::llvm::makeMutableArrayRef(c())) +// CHECK: for (auto *successor : ::llvm::MutableArrayRef(c())) // CHECK-NEXT: if (::mlir::failed([[$O_SUCCESSOR_CONSTRAINT]](*this, successor, "c", index++))) // CHECK-NEXT:return ::mlir::failure(); Index: mlir/lib/Dialect/Affine/Transforms/LoopCoalescing.cpp === --- mlir/lib/Dialect/Affine/Transforms/LoopCoalescing.cpp +++ mlir/lib/Dialect/Affine/Transforms/LoopCoalescing.cpp @@ -80,8 +80,7 @@ LLVM_DEBUG(llvm::dbgs() << " found coalesceable band from " << start
[PATCH] D141814: [llvm][ADT] Replace uses of `makeMutableArrayRef` with deduction guides
serge-sans-paille added a comment. LGTM Comment at: lldb/source/Host/common/NativeProcessProtocol.cpp:652 auto data = + llvm::MutableArrayRef(static_cast(buf), bytes_read); random nit: This could be rewritten as ``` llvm::MutableArrayRef data(static_cast(buf), bytes_read); ``` now Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141814/new/ https://reviews.llvm.org/D141814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D141814: [llvm][ADT] Replace uses of `makeMutableArrayRef` with deduction guides
jloser created this revision. jloser added reviewers: MaskRay, serge-sans-paille, dblaikie. Herald added subscribers: Moerafaat, zero9178, bzcheeseman, kosarev, ayermolo, sdasgup3, wenzhicui, wrengr, foad, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, kerbowa, liufengdb, aartbik, mgester, arpith-jacob, csigg, antiagainst, shauheen, rriddle, mehdi_amini, kadircet, arphaman, hiraditya, arichardson, jvesely, emaste, arsenm. Herald added a reviewer: aartbik. Herald added a reviewer: bondhugula. Herald added a reviewer: rafauler. Herald added a reviewer: Amir. Herald added a reviewer: maksfb. Herald added a project: All. jloser requested review of this revision. Herald added a reviewer: nicolasvasilache. Herald added subscribers: cfe-commits, llvm-commits, lldb-commits, pcwang-thead, yota9, stephenneuendorffer, nicolasvasilache. Herald added a reviewer: dcaballe. Herald added projects: clang, LLDB, MLIR, LLVM, clang-tools-extra. Similar to how `makeArrayRef` is deprecated in favor of deduction guides, do the same for `makeMutableArrayRef`. Once all of the places in-tree are using the deduction guides for `MutableArrayRef`, we can mark `makeMutableArrayRef` as deprecated. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D141814 Files: bolt/lib/Profile/DataAggregator.cpp clang-tools-extra/clangd/FuzzyMatch.cpp clang-tools-extra/clangd/SemanticSelection.cpp clang-tools-extra/clangd/index/dex/Trigram.cpp clang-tools-extra/pseudo/include/clang-pseudo/Forest.h clang/include/clang/AST/DeclOpenMP.h clang/include/clang/AST/OpenMPClause.h clang/include/clang/AST/StmtOpenMP.h clang/include/clang/Lex/MacroInfo.h clang/lib/AST/StmtOpenMP.cpp lld/COFF/Chunks.cpp lld/COFF/DebugTypes.cpp lld/COFF/Writer.cpp lld/ELF/InputFiles.h lld/ELF/SyntheticSections.cpp lldb/source/Host/common/NativeProcessProtocol.cpp llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h llvm/include/llvm/IR/DataLayout.h llvm/include/llvm/IR/Metadata.h llvm/include/llvm/ProfileData/InstrProf.h llvm/include/llvm/Support/Parallel.h llvm/lib/Analysis/ConstantFolding.cpp llvm/lib/ExecutionEngine/ExecutionEngine.cpp llvm/lib/Support/Path.cpp llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp llvm/lib/Transforms/Scalar/IndVarSimplify.cpp llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp llvm/unittests/Support/Path.cpp mlir/lib/Bytecode/Writer/IRNumbering.cpp mlir/lib/Dialect/Affine/Transforms/LoopCoalescing.cpp mlir/test/mlir-tblgen/constraint-unique.td mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp Index: mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp === --- mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp +++ mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp @@ -2746,7 +2746,7 @@ /// /// {0}: The region's index. const char *const getSingleRegion = - "::llvm::makeMutableArrayRef((*this)->getRegion({0}))"; + "::llvm::MutableArrayRef((*this)->getRegion({0}))"; // If we have no regions, there is nothing more to do. const auto canSkip = [](const NamedRegion ) { @@ -2781,7 +2781,7 @@ /// Get a single successor. /// /// {0}: The successor's name. - const char *const getSingleSuccessor = "::llvm::makeMutableArrayRef({0}())"; + const char *const getSingleSuccessor = "::llvm::MutableArrayRef({0}())"; // If we have no successors, there is nothing more to do. const auto canSkip = [](const NamedSuccessor ) { Index: mlir/test/mlir-tblgen/constraint-unique.td === --- mlir/test/mlir-tblgen/constraint-unique.td +++ mlir/test/mlir-tblgen/constraint-unique.td @@ -127,10 +127,10 @@ // CHECK: for (auto [[$RET_VALUE:.*]] : [[$RET_VALUE_GROUP]]) // CHECK-NEXT: if (::mlir::failed([[$A_TYPE_CONSTRAINT]](*this, [[$RET_VALUE]].getType(), "result", index++))) // CHECK-NEXT:return ::mlir::failure(); -// CHECK: for (auto : ::llvm::makeMutableArrayRef((*this)->getRegion(0))) +// CHECK: for (auto : ::llvm::MutableArrayRef((*this)->getRegion(0))) // CHECK-NEXT: if (::mlir::failed([[$A_REGION_CONSTRAINT]](*this, region, "d", index++))) // CHECK-NEXT:return ::mlir::failure(); -// CHECK: for (auto *successor : ::llvm::makeMutableArrayRef(c())) +// CHECK: for (auto *successor : ::llvm::MutableArrayRef(c())) // CHECK-NEXT: if (::mlir::failed([[$A_SUCCESSOR_CONSTRAINT]](*this, successor, "c", index++))) // CHECK-NEXT:return ::mlir::failure(); @@ -148,9 +148,9 @@ // CHECK: for (auto [[$RET_VALUE:.*]] : [[$RET_VALUE_GROUP]]) // CHECK-NEXT: if (::mlir::failed([[$O_TYPE_CONSTRAINT]](*this, [[$RET_VALUE]].getType(), "result", index++))) // CHECK-NEXT:return ::mlir::failure(); -// CHECK: for (auto : ::llvm::makeMutableArrayRef((*this)->getRegion(0))) +// CHECK: for (auto :