teemperor added inline comments.

================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h:117
+    // (CU, (DIE)nullptr) == (nullptr, nullptr) -> true
+    if (!m_die.IsValid() && !it.m_die.IsValid())
+      return true;
----------------
shafik wrote:
> I think:
> 
> ```
> bool operator==(const DWARFBaseDIE &lhs, const DWARFBaseDIE &rhs) {
>   return lhs.GetDIE() == rhs.GetDIE() && lhs.GetCU() == rhs.GetCU();
> }
> ```
> 
> will do the same thing but maybe I am confused.
> 
> Maybe we should have a unit test?
That's the `DWARFDIE::operator==` implementation called below and this special 
case is because of the comment one line above (we need to match the end 
iterator if it's default constructed when `GetSibling()` returns a DWARFDIE 
that has a valid CU but a `null` DIE).


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

https://reviews.llvm.org/D103172

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to