Instead of maintaining separate swig interface files, we can use the API headers directly. They implement the exact same C++ APIs and we can conditionally include the python extensions as needed. To remove the swig extensions from the API headers when building the LLDB framework, we can use the unifdef tool when it is available. Otherwise we just copy them as-is. Differential Revision: https://reviews.llvm.org/D142926
20 lines
837 B
OpenEdge ABL
20 lines
837 B
OpenEdge ABL
STRING_EXTENSION_OUTSIDE(SBCompileUnit)
|
|
|
|
%extend lldb::SBCompileUnit {
|
|
#ifdef SWIGPYTHON
|
|
%pythoncode %{
|
|
def __iter__(self):
|
|
'''Iterate over all line entries in a lldb.SBCompileUnit object.'''
|
|
return lldb_iter(self, 'GetNumLineEntries', 'GetLineEntryAtIndex')
|
|
|
|
def __len__(self):
|
|
'''Return the number of line entries in a lldb.SBCompileUnit
|
|
object.'''
|
|
return self.GetNumLineEntries()
|
|
|
|
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.''')
|
|
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.''')
|
|
%}
|
|
#endif
|
|
}
|