[PATCH] D108261: [DebugInfo] Fix end_sequence of debug_line in LTO Object

Kyungwoo Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 14 10:13:13 PST 2021


kyulee added inline comments.


================
Comment at: llvm/lib/MC/MCDwarf.cpp:148
+  auto &Entries = MCLineDivisions[Sec];
+  if (!Entries.empty()) {
+    auto EndEntry = Entries.back();
----------------
dblaikie wrote:
> When does this situation come up? (I think this question got lost from its previous place here: https://reviews.llvm.org/D108261#inline-1086075 during refactoring)
> 
> (if it is necessary, it might be suitable to use `find` on the `MCLineDivisions` rather than `operator[]` (so this call doesn't create an entry when it's empty/unused))
Even though we have a range, we may not have any debug line entry in unit tests.

Makes sense using `find`. Will update it with additional assembly test.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108261



More information about the llvm-commits mailing list