[lldb/API] Turn SBCompileUnit::GetIndexForLineEntry into FindLineEntryIndex (NFC)
authorMed Ismail Bennani <medismail.bennani@gmail.com>
Fri, 13 May 2022 23:50:52 +0000 (16:50 -0700)
committerMed Ismail Bennani <medismail.bennani@gmail.com>
Sat, 14 May 2022 01:33:05 +0000 (18:33 -0700)
This patch renames the `SBCompileUnit::GetIndexForLineEntry` api to be
an overload of `SBCompileUnit::FindLineEntryIndex`

Differential Revision: https://reviews.llvm.org/D125594

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
lldb/bindings/interface/SBCompileUnit.i
lldb/include/lldb/API/SBCompileUnit.h
lldb/source/API/SBCompileUnit.cpp
lldb/test/API/python_api/compile_unit/TestCompileUnitAPI.py

index a633ee7..5a03069 100644 (file)
@@ -79,9 +79,9 @@ public:
 
      @return
         The index of the user-provided line entry. UINT32_MAX if the line entry
-        was not found in the compile unit.") GetIndexForLineEntry;
+        was not found in the compile unit.") FindLineEntryIndex;
     uint32_t
-    GetIndexForLineEntry (lldb::SBLineEntry &line_entry, bool exact = false) const;
+    FindLineEntryIndex (lldb::SBLineEntry &line_entry, bool exact = false) const;
 
     uint32_t
     FindLineEntryIndex (uint32_t start_idx,
index 18da48b..36492d9 100644 (file)
@@ -34,8 +34,8 @@ public:
 
   lldb::SBLineEntry GetLineEntryAtIndex(uint32_t idx) const;
 
-  uint32_t GetIndexForLineEntry(lldb::SBLineEntry &line_entry,
-                                bool exact = false) const;
+  uint32_t FindLineEntryIndex(lldb::SBLineEntry &line_entry,
+                              bool exact = false) const;
 
   uint32_t FindLineEntryIndex(uint32_t start_idx, uint32_t line,
                               lldb::SBFileSpec *inline_file_spec) const;
index 610860f..3aa65e2 100644 (file)
@@ -77,8 +77,8 @@ SBLineEntry SBCompileUnit::GetLineEntryAtIndex(uint32_t idx) const {
   return sb_line_entry;
 }
 
-uint32_t SBCompileUnit::GetIndexForLineEntry(lldb::SBLineEntry &line_entry,
-                                             bool exact) const {
+uint32_t SBCompileUnit::FindLineEntryIndex(lldb::SBLineEntry &line_entry,
+                                           bool exact) const {
   LLDB_INSTRUMENT_VA(this, line_entry, exact);
 
   if (!m_opaque_ptr || !line_entry.IsValid())
index 2c4ebf7..9f7de01 100644 (file)
@@ -37,7 +37,7 @@ class CompileUnitAPITestCase(TestBase):
         main_cu = sc_list.compile_units[0]
         self.assertTrue(main_cu.IsValid(), "Main executable CU is not valid")
 
-        self.assertEqual(main_cu.GetIndexForLineEntry(line_entry, True),
+        self.assertEqual(main_cu.FindLineEntryIndex(line_entry, True),
                          main_cu.FindLineEntryIndex(0, line_entry.GetLine(),
                                    line_entry.GetFileSpec(), True))