[PATCH] D42801: [DebugInfo] Don't insert DEBUG_VALUE after terminators

Wolfgang Pieb via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 7 10:28:54 PST 2018


wolfgangp added a comment.

Change LGTM with minor comment on possible readability improvement.



================
Comment at: lib/CodeGen/LiveDebugVariables.cpp:1103
+                                      StopIdx, LIS.getInstructionIndex(*I))) ||
+        I->isTerminator())
       break;
----------------
The change makes perfect sense. From a readability point of view, I'd perhaps prefer to express this concept in the while condition, or else have a separate if statement for it, i.e. either

while (I != MBB->end() && !I->isTerminator())

or

while (I != MBB->end()) {
    if (I->isTerminator())
      break;
    if (!LIS.....



https://reviews.llvm.org/D42801





More information about the llvm-commits mailing list