[Lldb-commits] [PATCH] D100962: [lldb/Core] Add SourceLocationSpec class (NFC)

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 29 20:17:31 PDT 2021


JDevlieghere added inline comments.


================
Comment at: lldb/source/Core/SourceLocationSpec.cpp:48-61
+  if (int result = FileSpec::Compare(a.GetFileSpec(), b.GetFileSpec(), full))
+    return result;
+
+  // If both file_spec matches, compare line numbers.
+  if (a.GetLine() != b.GetLine()) {
+    return (a.GetLine() < b.GetLine()) ? -1 : 1;
+  }
----------------
As this is only using members form Declaration, should it be implemented there?


================
Comment at: lldb/source/Core/SourceLocationSpec.cpp:72-77
+  GetFileSpec().Dump(s);
+  s << ':' << GetLine();
+
+  auto column = GetColumn();
+  if (column)
+    s << ':' << *column;
----------------
Looks like `Declaration` has a Dump method, so I guess this should just call that. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100962



More information about the lldb-commits mailing list