[PATCH] D54465: [CodeGen] Fix bugs in LiveDebugVariables when debug labels are generated.

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 8 15:06:36 PST 2019


probinson added a comment.

A few more comments.



================
Comment at: lib/CodeGen/LiveDebugVariables.cpp:589
+  for (auto const &L : userLabels) {
+    // The Label has existed in userLabels.
+    if (L->match(Label, DL->getInlinedAt(), Idx))
----------------
The phrasing of the comment makes it sound like an assertion, rather than a description of the purpose of the loop.  Maybe:
`Nothing to do if Label already exists in userLabels.`



================
Comment at: lib/CodeGen/LiveDebugVariables.cpp:678
+  const DILabel *Label = MI.getDebugLabel();
+  addUserLabel(Label, MI.getDebugLoc(), Idx);
+  return true;
----------------
`addUserLabel` is short and not used anywhere else, so I think it would be preferable to simply put that code inline here and not have the extra method.


================
Comment at: test/CodeGen/Generic/live-debug-label.ll:40
+; CHECK: DBG_LABEL !14
+; CHECK-LABEL: if.then5:
+; CHECK: DBG_LABEL !14
----------------
These CHECK-LABEL directives can simply be CHECK directives.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D54465





More information about the llvm-commits mailing list