Add "operator bool" to SB APIs
authorPavel Labath <pavel@labath.sk>
Mon, 11 Mar 2019 13:58:46 +0000 (13:58 +0000)
committerPavel Labath <pavel@labath.sk>
Mon, 11 Mar 2019 13:58:46 +0000 (13:58 +0000)
commit7f5237bccc27103c2718139e8316f14028ca9a5e
tree11a9d4cf1be8828f7fd14ffa958bd6758613568a
parent52760bf43525018bf19b5d3533d3e0b907bb8dae
Add "operator bool" to SB APIs

Summary:
Our python version of the SB API has (the python equivalent of)
operator bool, but the C++ version doesn't.

This is because our python operators are added by modify-python-lldb.py,
which performs postprocessing on the swig-generated interface files.

In this patch, I add the "operator bool" to all SB classes which have an
IsValid method (which is the same logic used by modify-python-lldb.py).
This way, we make the two interfaces more constent, and it allows us to
rely on swig's automatic syntesis of python __nonzero__ methods instead
of doing manual fixups.

Reviewers: zturner, jingham, clayborg, jfb, serge-sans-paille

Subscribers: jdoerfert, lldb-commits

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

llvm-svn: 355824
168 files changed:
lldb/include/lldb/API/SBAddress.h
lldb/include/lldb/API/SBBlock.h
lldb/include/lldb/API/SBBreakpoint.h
lldb/include/lldb/API/SBBreakpointLocation.h
lldb/include/lldb/API/SBBreakpointName.h
lldb/include/lldb/API/SBBroadcaster.h
lldb/include/lldb/API/SBCommandInterpreter.h
lldb/include/lldb/API/SBCommandReturnObject.h
lldb/include/lldb/API/SBCommunication.h
lldb/include/lldb/API/SBCompileUnit.h
lldb/include/lldb/API/SBData.h
lldb/include/lldb/API/SBDebugger.h
lldb/include/lldb/API/SBDeclaration.h
lldb/include/lldb/API/SBError.h
lldb/include/lldb/API/SBEvent.h
lldb/include/lldb/API/SBFileSpec.h
lldb/include/lldb/API/SBFrame.h
lldb/include/lldb/API/SBFunction.h
lldb/include/lldb/API/SBInstruction.h
lldb/include/lldb/API/SBInstructionList.h
lldb/include/lldb/API/SBLineEntry.h
lldb/include/lldb/API/SBListener.h
lldb/include/lldb/API/SBModule.h
lldb/include/lldb/API/SBModuleSpec.h
lldb/include/lldb/API/SBPlatform.h
lldb/include/lldb/API/SBProcess.h
lldb/include/lldb/API/SBProcessInfo.h
lldb/include/lldb/API/SBQueue.h
lldb/include/lldb/API/SBQueueItem.h
lldb/include/lldb/API/SBSection.h
lldb/include/lldb/API/SBStream.h
lldb/include/lldb/API/SBStringList.h
lldb/include/lldb/API/SBStructuredData.h
lldb/include/lldb/API/SBSymbol.h
lldb/include/lldb/API/SBSymbolContext.h
lldb/include/lldb/API/SBSymbolContextList.h
lldb/include/lldb/API/SBTarget.h
lldb/include/lldb/API/SBThread.h
lldb/include/lldb/API/SBThreadCollection.h
lldb/include/lldb/API/SBThreadPlan.h
lldb/include/lldb/API/SBTrace.h
lldb/include/lldb/API/SBTraceOptions.h
lldb/include/lldb/API/SBType.h
lldb/include/lldb/API/SBTypeCategory.h
lldb/include/lldb/API/SBTypeEnumMember.h
lldb/include/lldb/API/SBTypeFilter.h
lldb/include/lldb/API/SBTypeFormat.h
lldb/include/lldb/API/SBTypeNameSpecifier.h
lldb/include/lldb/API/SBTypeSummary.h
lldb/include/lldb/API/SBTypeSynthetic.h
lldb/include/lldb/API/SBUnixSignals.h
lldb/include/lldb/API/SBValue.h
lldb/include/lldb/API/SBValueList.h
lldb/include/lldb/API/SBVariablesOptions.h
lldb/include/lldb/API/SBWatchpoint.h
lldb/scripts/Python/modify-python-lldb.py
lldb/scripts/interface/SBAddress.i
lldb/scripts/interface/SBBlock.i
lldb/scripts/interface/SBBreakpoint.i
lldb/scripts/interface/SBBreakpointLocation.i
lldb/scripts/interface/SBBreakpointName.i
lldb/scripts/interface/SBBroadcaster.i
lldb/scripts/interface/SBCommandInterpreter.i
lldb/scripts/interface/SBCommandReturnObject.i
lldb/scripts/interface/SBCommunication.i
lldb/scripts/interface/SBCompileUnit.i
lldb/scripts/interface/SBData.i
lldb/scripts/interface/SBDebugger.i
lldb/scripts/interface/SBDeclaration.i
lldb/scripts/interface/SBError.i
lldb/scripts/interface/SBEvent.i
lldb/scripts/interface/SBFileSpec.i
lldb/scripts/interface/SBFrame.i
lldb/scripts/interface/SBFunction.i
lldb/scripts/interface/SBInstruction.i
lldb/scripts/interface/SBInstructionList.i
lldb/scripts/interface/SBLineEntry.i
lldb/scripts/interface/SBListener.i
lldb/scripts/interface/SBModule.i
lldb/scripts/interface/SBModuleSpec.i
lldb/scripts/interface/SBPlatform.i
lldb/scripts/interface/SBProcess.i
lldb/scripts/interface/SBProcessInfo.i
lldb/scripts/interface/SBQueue.i
lldb/scripts/interface/SBQueueItem.i
lldb/scripts/interface/SBSection.i
lldb/scripts/interface/SBStream.i
lldb/scripts/interface/SBStringList.i
lldb/scripts/interface/SBStructuredData.i
lldb/scripts/interface/SBSymbol.i
lldb/scripts/interface/SBSymbolContext.i
lldb/scripts/interface/SBSymbolContextList.i
lldb/scripts/interface/SBTarget.i
lldb/scripts/interface/SBThread.i
lldb/scripts/interface/SBThreadCollection.i
lldb/scripts/interface/SBThreadPlan.i
lldb/scripts/interface/SBTrace.i
lldb/scripts/interface/SBTraceOptions.i
lldb/scripts/interface/SBType.i
lldb/scripts/interface/SBTypeCategory.i
lldb/scripts/interface/SBTypeEnumMember.i
lldb/scripts/interface/SBTypeFilter.i
lldb/scripts/interface/SBTypeFormat.i
lldb/scripts/interface/SBTypeNameSpecifier.i
lldb/scripts/interface/SBTypeSummary.i
lldb/scripts/interface/SBTypeSynthetic.i
lldb/scripts/interface/SBUnixSignals.i
lldb/scripts/interface/SBValue.i
lldb/scripts/interface/SBValueList.i
lldb/scripts/interface/SBVariablesOptions.i
lldb/scripts/interface/SBWatchpoint.i
lldb/scripts/lldb.swig
lldb/source/API/SBAddress.cpp
lldb/source/API/SBBlock.cpp
lldb/source/API/SBBreakpoint.cpp
lldb/source/API/SBBreakpointLocation.cpp
lldb/source/API/SBBreakpointName.cpp
lldb/source/API/SBBroadcaster.cpp
lldb/source/API/SBCommandInterpreter.cpp
lldb/source/API/SBCommandReturnObject.cpp
lldb/source/API/SBCommunication.cpp
lldb/source/API/SBCompileUnit.cpp
lldb/source/API/SBData.cpp
lldb/source/API/SBDebugger.cpp
lldb/source/API/SBDeclaration.cpp
lldb/source/API/SBError.cpp
lldb/source/API/SBEvent.cpp
lldb/source/API/SBFileSpec.cpp
lldb/source/API/SBFrame.cpp
lldb/source/API/SBFunction.cpp
lldb/source/API/SBInstruction.cpp
lldb/source/API/SBInstructionList.cpp
lldb/source/API/SBLineEntry.cpp
lldb/source/API/SBListener.cpp
lldb/source/API/SBModule.cpp
lldb/source/API/SBModuleSpec.cpp
lldb/source/API/SBPlatform.cpp
lldb/source/API/SBProcess.cpp
lldb/source/API/SBProcessInfo.cpp
lldb/source/API/SBQueue.cpp
lldb/source/API/SBQueueItem.cpp
lldb/source/API/SBReproducer.cpp
lldb/source/API/SBSection.cpp
lldb/source/API/SBStream.cpp
lldb/source/API/SBStringList.cpp
lldb/source/API/SBStructuredData.cpp
lldb/source/API/SBSymbol.cpp
lldb/source/API/SBSymbolContext.cpp
lldb/source/API/SBSymbolContextList.cpp
lldb/source/API/SBTarget.cpp
lldb/source/API/SBThread.cpp
lldb/source/API/SBThreadCollection.cpp
lldb/source/API/SBThreadPlan.cpp
lldb/source/API/SBTrace.cpp
lldb/source/API/SBTraceOptions.cpp
lldb/source/API/SBType.cpp
lldb/source/API/SBTypeCategory.cpp
lldb/source/API/SBTypeEnumMember.cpp
lldb/source/API/SBTypeFilter.cpp
lldb/source/API/SBTypeFormat.cpp
lldb/source/API/SBTypeNameSpecifier.cpp
lldb/source/API/SBTypeSummary.cpp
lldb/source/API/SBTypeSynthetic.cpp
lldb/source/API/SBUnixSignals.cpp
lldb/source/API/SBValue.cpp
lldb/source/API/SBValueList.cpp
lldb/source/API/SBVariablesOptions.cpp
lldb/source/API/SBWatchpoint.cpp