[Lldb-commits] [lldb] 174cf2f - [lldb/API] Turn SBCompileUnit::GetIndexForLineEntry into FindLineEntryIndex (NFC)

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Fri May 13 18:33:20 PDT 2022


Author: Med Ismail Bennani
Date: 2022-05-13T18:33:05-07:00
New Revision: 174cf2f7476224c167608290d27eac846834dace

URL: https://github.com/llvm/llvm-project/commit/174cf2f7476224c167608290d27eac846834dace
DIFF: https://github.com/llvm/llvm-project/commit/174cf2f7476224c167608290d27eac846834dace.diff

LOG: [lldb/API] Turn SBCompileUnit::GetIndexForLineEntry into FindLineEntryIndex (NFC)

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 at gmail.com>

Added: 
    

Modified: 
    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

Removed: 
    


################################################################################
diff  --git a/lldb/bindings/interface/SBCompileUnit.i b/lldb/bindings/interface/SBCompileUnit.i
index a633ee78d6f7e..5a03069b4e045 100644
--- a/lldb/bindings/interface/SBCompileUnit.i
+++ b/lldb/bindings/interface/SBCompileUnit.i
@@ -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,

diff  --git a/lldb/include/lldb/API/SBCompileUnit.h b/lldb/include/lldb/API/SBCompileUnit.h
index 18da48bf11711..36492d9398ce9 100644
--- a/lldb/include/lldb/API/SBCompileUnit.h
+++ b/lldb/include/lldb/API/SBCompileUnit.h
@@ -34,8 +34,8 @@ class LLDB_API SBCompileUnit {
 
   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;

diff  --git a/lldb/source/API/SBCompileUnit.cpp b/lldb/source/API/SBCompileUnit.cpp
index 610860f1be825..3aa65e225d7ab 100644
--- a/lldb/source/API/SBCompileUnit.cpp
+++ b/lldb/source/API/SBCompileUnit.cpp
@@ -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())

diff  --git a/lldb/test/API/python_api/compile_unit/TestCompileUnitAPI.py b/lldb/test/API/python_api/compile_unit/TestCompileUnitAPI.py
index 2c4ebf7982d96..9f7de01d85da4 100644
--- a/lldb/test/API/python_api/compile_unit/TestCompileUnitAPI.py
+++ b/lldb/test/API/python_api/compile_unit/TestCompileUnitAPI.py
@@ -37,7 +37,7 @@ def test(self):
         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))
 


        


More information about the lldb-commits mailing list