[llvm] MTM: fix issues after cursory reading (PR #100404)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 02:05:36 PDT 2024


================
@@ -146,15 +140,14 @@ MachineTraceMetrics::getProcReleaseAtCycles(unsigned MBBNum) const {
          "getResources() must be called before getProcReleaseAtCycles()");
   unsigned PRKinds = SchedModel.getNumProcResourceKinds();
   assert((MBBNum+1) * PRKinds <= ProcReleaseAtCycles.size());
-  return ArrayRef(ProcReleaseAtCycles.data() + MBBNum * PRKinds, PRKinds);
+  return ArrayRef{ProcReleaseAtCycles.data() + MBBNum * PRKinds, PRKinds};
----------------
nikic wrote:

We don't really use `ClassName{}` style constructors inside LLVM unless there is some specific reason to do so. This should either stay as `ArrayRef()` or become `{}` without mentioning the name at all.

https://github.com/llvm/llvm-project/pull/100404


More information about the llvm-commits mailing list