[Lldb-commits] [PATCH] D55574: Remove else statements after returns
Jonas Devlieghere via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Dec 11 13:08:34 PST 2018
JDevlieghere created this revision.
JDevlieghere added a reviewer: LLDB.
Herald added subscribers: jsji, teemperor, abidh, arphaman, atanasyan, kbarton, arichardson, javed.absar, ki.stfu, nemanjai, kubamracek, sdardis, emaste, srhines.
Herald added a reviewer: espindola.
Herald added a reviewer: jfb.
Herald added a reviewer: shafik.
While writing a patch I noticed myself removing a few `else` statements after `return` statements. Rather than doing this ad-hoc I remembered there's a clang-tidy pass that does this.
https://clang.llvm.org/extra/clang-tidy/checks/readability-else-after-return.html
So essentially what I did was run the following command over the LLDB code base:
run-clang-tidy.py -checks='-*,readability-else-after-return' -format -fix $PWD
I'm not sure if it's worth the churn, but I do believe lldb could benefit from some reduced indentation.
PS: Diff is without context, otherwise it exceeds the Phabricator limit of 8 megabytes.
Repository:
rLLDB LLDB
https://reviews.llvm.org/D55574
Files:
include/lldb/Breakpoint/BreakpointResolver.h
include/lldb/Core/Broadcaster.h
include/lldb/Core/Event.h
include/lldb/Core/FileSpecList.h
include/lldb/Core/RangeMap.h
include/lldb/Core/SearchFilter.h
include/lldb/Core/StructuredDataImpl.h
include/lldb/Core/ValueObject.h
include/lldb/DataFormatters/FormattersContainer.h
include/lldb/DataFormatters/FormattersHelpers.h
include/lldb/DataFormatters/TypeCategory.h
include/lldb/Host/ProcessRunLock.h
include/lldb/Interpreter/CommandObject.h
include/lldb/Symbol/ClangASTImporter.h
include/lldb/Symbol/ClangExternalASTSourceCommon.h
include/lldb/Symbol/DebugMacros.h
include/lldb/Symbol/Symbol.h
include/lldb/Symbol/Type.h
include/lldb/Target/ObjCLanguageRuntime.h
include/lldb/Target/Process.h
include/lldb/Target/StackFrameList.h
include/lldb/Target/StopInfo.h
include/lldb/Target/ThreadPlan.h
include/lldb/Target/ThreadPlanCallFunction.h
include/lldb/Target/ThreadSpec.h
source/API/SBAddress.cpp
source/API/SBBreakpoint.cpp
source/API/SBBreakpointLocation.cpp
source/API/SBBreakpointName.cpp
source/API/SBCommandReturnObject.cpp
source/API/SBDebugger.cpp
source/API/SBEvent.cpp
source/API/SBInstruction.cpp
source/API/SBListener.cpp
source/API/SBProcess.cpp
source/API/SBSourceManager.cpp
source/API/SBThread.cpp
source/API/SBThreadPlan.cpp
source/API/SBTypeCategory.cpp
source/API/SBTypeFilter.cpp
source/API/SBTypeFormat.cpp
source/API/SBTypeSummary.cpp
source/API/SBTypeSynthetic.cpp
source/API/SBValue.cpp
source/API/SBWatchpoint.cpp
source/Breakpoint/Breakpoint.cpp
source/Breakpoint/BreakpointIDList.cpp
source/Breakpoint/BreakpointLocation.cpp
source/Breakpoint/BreakpointLocationList.cpp
source/Breakpoint/BreakpointOptions.cpp
source/Breakpoint/BreakpointResolver.cpp
source/Breakpoint/BreakpointResolverName.cpp
source/Breakpoint/BreakpointResolverScripted.cpp
source/Breakpoint/BreakpointSiteList.cpp
source/Breakpoint/Watchpoint.cpp
source/Breakpoint/WatchpointOptions.cpp
source/Commands/CommandCompletions.cpp
source/Commands/CommandObjectBreakpoint.cpp
source/Commands/CommandObjectCommands.cpp
source/Commands/CommandObjectDisassemble.cpp
source/Commands/CommandObjectFrame.cpp
source/Commands/CommandObjectHelp.cpp
source/Commands/CommandObjectMemory.cpp
source/Commands/CommandObjectMultiword.cpp
source/Commands/CommandObjectPlatform.cpp
source/Commands/CommandObjectProcess.cpp
source/Commands/CommandObjectSettings.cpp
source/Commands/CommandObjectSource.cpp
source/Commands/CommandObjectTarget.cpp
source/Commands/CommandObjectThread.cpp
source/Commands/CommandObjectType.cpp
source/Commands/CommandObjectWatchpoint.cpp
source/Core/Address.cpp
source/Core/AddressRange.cpp
source/Core/Broadcaster.cpp
source/Core/Debugger.cpp
source/Core/Disassembler.cpp
source/Core/DumpDataExtractor.cpp
source/Core/DynamicLoader.cpp
source/Core/Event.cpp
source/Core/FormatEntity.cpp
source/Core/IOHandler.cpp
source/Core/Listener.cpp
source/Core/Mangled.cpp
source/Core/Module.cpp
source/Core/ModuleList.cpp
source/Core/PluginManager.cpp
source/Core/SearchFilter.cpp
source/Core/Section.cpp
source/Core/SourceManager.cpp
source/Core/Value.cpp
source/Core/ValueObject.cpp
source/Core/ValueObjectConstResultImpl.cpp
source/Core/ValueObjectDynamicValue.cpp
source/Core/ValueObjectRegister.cpp
source/Core/ValueObjectSyntheticFilter.cpp
source/Core/ValueObjectVariable.cpp
source/DataFormatters/CXXFunctionPointer.cpp
source/DataFormatters/FormatManager.cpp
source/DataFormatters/TypeCategory.cpp
source/DataFormatters/TypeFormat.cpp
source/DataFormatters/TypeSummary.cpp
source/DataFormatters/ValueObjectPrinter.cpp
source/Expression/DWARFExpression.cpp
source/Expression/ExpressionSourceCode.cpp
source/Expression/ExpressionVariable.cpp
source/Expression/IRDynamicChecks.cpp
source/Expression/IRExecutionUnit.cpp
source/Expression/IRInterpreter.cpp
source/Expression/IRMemoryMap.cpp
source/Expression/LLVMUserExpression.cpp
source/Expression/UserExpression.cpp
source/Host/common/File.cpp
source/Host/common/Host.cpp
source/Host/common/NativeProcessProtocol.cpp
source/Host/common/NativeRegisterContext.cpp
source/Host/common/Symbols.cpp
source/Host/common/UDPSocket.cpp
source/Host/common/XML.cpp
source/Host/macosx/Symbols.cpp
source/Host/macosx/objcxx/Host.mm
source/Host/posix/ConnectionFileDescriptorPosix.cpp
source/Interpreter/CommandInterpreter.cpp
source/Interpreter/CommandObject.cpp
source/Interpreter/CommandObjectRegexCommand.cpp
source/Interpreter/OptionArgParser.cpp
source/Interpreter/OptionGroupFormat.cpp
source/Interpreter/OptionValueArray.cpp
source/Interpreter/OptionValuePathMappings.cpp
source/Interpreter/OptionValueProperties.cpp
source/Interpreter/Options.cpp
source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp
source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp
source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp
source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp
source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
source/Plugins/Architecture/Mips/ArchitectureMips.cpp
source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp
source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h
source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp
source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h
source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h
source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
source/Plugins/Instruction/ARM/EmulationStateARM.cpp
source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp
source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp
source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
source/Plugins/Language/CPlusPlus/LibCxx.cpp
source/Plugins/Language/CPlusPlus/LibCxxList.cpp
source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
source/Plugins/Language/ClangCommon/ClangHighlighter.cpp
source/Plugins/Language/ObjC/NSArray.cpp
source/Plugins/Language/ObjC/NSDictionary.cpp
source/Plugins/Language/ObjC/NSError.cpp
source/Plugins/Language/ObjC/NSException.cpp
source/Plugins/Language/ObjC/NSSet.cpp
source/Plugins/Language/ObjC/NSString.cpp
source/Plugins/Language/ObjC/ObjCLanguage.h
source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
source/Plugins/Platform/Android/AdbClient.cpp
source/Plugins/Platform/Android/PlatformAndroid.cpp
source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
source/Plugins/Platform/Linux/PlatformLinux.cpp
source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp
source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp
source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp
source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp
source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm
source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp
source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
source/Plugins/Platform/Windows/PlatformWindows.cpp
source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
source/Plugins/Process/Utility/ARMUtils.h
source/Plugins/Process/Utility/NativeRegisterContextRegisterInfo.cpp
source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp
source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
source/Plugins/Process/Utility/RegisterContextLLDB.cpp
source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp
source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp
source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp
source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp
source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp
source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
source/Plugins/Process/Utility/StopInfoMachException.cpp
source/Plugins/Process/Utility/UnwindLLDB.cpp
source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.cpp
source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.cpp
source/Plugins/Process/elf-core/ThreadElfCore.cpp
source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationHistory.h
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
source/Plugins/Process/mach-core/ProcessMachCore.cpp
source/Plugins/Process/minidump/MinidumpParser.cpp
source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
source/Plugins/SymbolFile/DWARF/DIERef.cpp
source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
(110 more files...)
More information about the lldb-commits
mailing list