[NFC][Coroutines] Use structured binding with llvm::enumerate in CoroSplit (#116879)
[llvm-project.git] / lldb / bindings / interface / SBCompileUnitExtensions.i
blobde6c54cbaf3b977e42d861ff2ab9e9b906626ca3
1 STRING_EXTENSION_OUTSIDE(SBCompileUnit)
3 %extend lldb::SBCompileUnit {
4 #ifdef SWIGPYTHON
5 %pythoncode %{
6 # operator== is a free function, which swig does not handle, so we inject
7 # our own equality operator here
8 def __eq__(self, other):
9 return not self.__ne__(other)
11 def __iter__(self):
12 '''Iterate over all line entries in a lldb.SBCompileUnit object.'''
13 return lldb_iter(self, 'GetNumLineEntries', 'GetLineEntryAtIndex')
15 def __len__(self):
16 '''Return the number of line entries in a lldb.SBCompileUnit
17 object.'''
18 return self.GetNumLineEntries()
20 file = property(GetFileSpec, None, doc='''A read only property that returns the same result an lldb object that represents the source file (lldb.SBFileSpec) for the compile unit.''')
21 num_line_entries = property(GetNumLineEntries, None, doc='''A read only property that returns the number of line entries in a compile unit as an integer.''')
23 #endif