[PATCH] D41672: support phi ranges for machine-level IR
Davide Italiano via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 2 14:58:37 PST 2018
davide accepted this revision.
davide added a comment.
Nice to see this for MBB, +1 modulo two minors.
================
Comment at: CodeGen/MachineInstrTest.cpp:262-265
+ for (auto &PN : BB->phis()) {
+ (void)PN;
+ EXPECT_TRUE(false) << "empty block should have no phis";
+ }
----------------
EXPECT in gtest is non-fatal so maybe you want ASSERT_ here
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md
================
Comment at: llvm/CodeGen/MachineBasicBlock.h:228-233
+ inline iterator_range<iterator> phis() {
+ return make_range(begin(), getFirstNonPHI());
+ }
+ inline iterator_range<const_iterator> phis() const {
+ return const_cast<MachineBasicBlock *>(this)->phis();
+ }
----------------
Doxygen comment for these two?
https://reviews.llvm.org/D41672
More information about the llvm-commits
mailing list