[PATCH] D140955: Move from llvm::makeArrayRef to ArrayRef deduction guides - llvm/ part
Mehdi AMINI via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 5 03:01:12 PST 2023
mehdi_amini added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp:347
const std::array<unsigned, 3> RegSrcOpIdx = { { 0, 2, 3 } };
- return addMappingFromTable<3>(MI, MRI, RegSrcOpIdx, makeArrayRef(Table));
+ return addMappingFromTable<3>(MI, MRI, RegSrcOpIdx, ArrayRef(Table));
}
----------------
dblaikie wrote:
> mehdi_amini wrote:
> > It seems that in such cases we can remove the explicit `ArrayRef(...)` around `Table` here right ?
> >
> > (I wonder if a clang-tidy check could detect this maybe?)
> Perhaps these would be considered pre-existing issues, since they could've been written the way you are suggesting even without CTAD for `ArrayRef` - but, yeah, if they can be simply cleaned up while doing this transformation, it'd be a perk/nice to have.
You're right, I thought that these simplification were enabled by CTAD but it seems the makeArrayRef were always spurious!
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D140955/new/
https://reviews.llvm.org/D140955
More information about the llvm-commits
mailing list