[PATCH] D101892: [DebugInfo] UnwindTable::create() should not add empty rows to CFI unwind table

Greg Clayton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 5 11:25:40 PDT 2021


clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

LGTM! Just had one nit code edit suggestion.



================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp:225-231
   UnwindRow Row;
   if (Error CieError = UT.parseRows(Cie->cfis(), Row, nullptr))
     return std::move(CieError);
-  UT.Rows.push_back(Row);
+  // Row will be empty if there are no CFI instructions.
+  if (!Cie->cfis().empty())
+    UT.Rows.push_back(Row);
   return UT;
----------------
We can return early if we check if empty first to avoid a function call here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101892



More information about the llvm-commits mailing list