[PATCH] D88455: [NFC][regalloc] Unit test for AllocationOrder iteration.

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 10:33:23 PDT 2020


mtrofin added inline comments.


================
Comment at: llvm/lib/CodeGen/AllocationOrder.h:46
+                                const RegisterClassInfo &RegClassInfo,
+                                const LiveRegMatrix *Matrix);
+
----------------
qcolombet wrote:
> What's the rationale for turning this constructor into a static method?
This allows the members of AllocationOrder to be const-ed (ArrayRef has read-only semantics, so that's the exception). This, imho, simplifies readability - one doesn't need to worry about mutation when glancing at this code.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88455/new/

https://reviews.llvm.org/D88455



More information about the llvm-commits mailing list