[Lldb-commits] [PATCH] D46144: Reflow paragraphs in comments.
Adrian Prantl via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Apr 26 14:30:33 PDT 2018
aprantl created this revision.
aprantl added reviewers: clayborg, jingham, jasonmolenda, labath.
Herald added subscribers: mgrang, JDevlieghere, kbarton, arichardson, nemanjai, kubamracek, emaste, srhines.
Herald added a reviewer: javed.absar.
Herald added a reviewer: espindola.
This is intended as a clean up after the big clang-format commit (r280751), which unfortunately resulted in many of the comment paragraphs in LLDB being very hard to read.
FYI the script I used was:
import textwrap
import commands
import os
import sys
import re
tmp = "%s.tmp"%sys.argv[1]
out = open(tmp, "w+")
with open(sys.argv[1], "r") as f:
header = ""
text = ""
for line in f:
comment = re.compile(r'^( *//) ([^ ].*)$')
match = comment.match(line)
if match:
# skip intentionally short comments.
if not text and len(match.group(2)) < 40:
out.write(line)
continue
if text:
text += " " + match.group(2)
else:
header = match.group(1)
text = match.group(2)
continue
else:
if text:
filled = textwrap.wrap(text, width=(73-len(header)),
break_long_words=False)
for l in filled:
out.write(header+" "+l+'\n')
text = ""
out.write(line)
os.rename(tmp, sys.argv[1])
#find source -name '*.cpp' -exec python join-comments.py \{} \;
https://reviews.llvm.org/D46144
Files:
source/API/SBAddress.cpp
source/API/SBCommandInterpreter.cpp
source/API/SBDebugger.cpp
source/API/SBError.cpp
source/API/SBEvent.cpp
source/API/SBFrame.cpp
source/API/SBInstruction.cpp
source/API/SBLaunchInfo.cpp
source/API/SBModule.cpp
source/API/SBModuleSpec.cpp
source/API/SBPlatform.cpp
source/API/SBProcess.cpp
source/API/SBQueueItem.cpp
source/API/SBStream.cpp
source/API/SBTarget.cpp
source/API/SBThread.cpp
source/API/SBThreadPlan.cpp
source/API/SBType.cpp
source/API/SBTypeCategory.cpp
source/API/SBValue.cpp
source/API/SystemInitializerFull.cpp
source/Breakpoint/Breakpoint.cpp
source/Breakpoint/BreakpointID.cpp
source/Breakpoint/BreakpointIDList.cpp
source/Breakpoint/BreakpointLocation.cpp
source/Breakpoint/BreakpointLocationList.cpp
source/Breakpoint/BreakpointOptions.cpp
source/Breakpoint/BreakpointResolver.cpp
source/Breakpoint/BreakpointResolverAddress.cpp
source/Breakpoint/BreakpointResolverFileLine.cpp
source/Breakpoint/BreakpointResolverName.cpp
source/Breakpoint/BreakpointSite.cpp
source/Breakpoint/BreakpointSiteList.cpp
source/Breakpoint/Watchpoint.cpp
source/Breakpoint/WatchpointList.cpp
source/Breakpoint/WatchpointOptions.cpp
source/Commands/CommandCompletions.cpp
source/Commands/CommandObjectApropos.cpp
source/Commands/CommandObjectBreakpoint.cpp
source/Commands/CommandObjectBreakpointCommand.cpp
source/Commands/CommandObjectCommands.cpp
source/Commands/CommandObjectDisassemble.cpp
source/Commands/CommandObjectExpression.cpp
source/Commands/CommandObjectFrame.cpp
source/Commands/CommandObjectHelp.cpp
source/Commands/CommandObjectLog.cpp
source/Commands/CommandObjectMemory.cpp
source/Commands/CommandObjectMultiword.cpp
source/Commands/CommandObjectPlatform.cpp
source/Commands/CommandObjectProcess.cpp
source/Commands/CommandObjectQuit.cpp
source/Commands/CommandObjectRegister.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/Commands/CommandObjectWatchpointCommand.cpp
source/Core/Address.cpp
source/Core/AddressResolverFileLine.cpp
source/Core/AddressResolverName.cpp
source/Core/Broadcaster.cpp
source/Core/Communication.cpp
source/Core/Debugger.cpp
source/Core/Disassembler.cpp
source/Core/DumpDataExtractor.cpp
source/Core/DynamicLoader.cpp
source/Core/FileSpecList.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/RegisterValue.cpp
source/Core/Scalar.cpp
source/Core/SearchFilter.cpp
source/Core/Section.cpp
source/Core/SourceManager.cpp
source/Core/Value.cpp
source/Core/ValueObject.cpp
source/Core/ValueObjectCast.cpp
source/Core/ValueObjectChild.cpp
source/Core/ValueObjectConstResult.cpp
source/Core/ValueObjectDynamicValue.cpp
source/Core/ValueObjectList.cpp
source/Core/ValueObjectMemory.cpp
source/Core/ValueObjectRegister.cpp
source/Core/ValueObjectSyntheticFilter.cpp
source/Core/ValueObjectVariable.cpp
source/DataFormatters/FormatManager.cpp
source/DataFormatters/StringPrinter.cpp
source/DataFormatters/TypeFormat.cpp
source/DataFormatters/ValueObjectPrinter.cpp
source/DataFormatters/VectorType.cpp
source/Expression/DWARFExpression.cpp
source/Expression/DiagnosticManager.cpp
source/Expression/ExpressionSourceCode.cpp
source/Expression/ExpressionVariable.cpp
source/Expression/FunctionCaller.cpp
source/Expression/IRDynamicChecks.cpp
source/Expression/IRExecutionUnit.cpp
source/Expression/IRInterpreter.cpp
source/Expression/IRMemoryMap.cpp
source/Expression/LLVMUserExpression.cpp
source/Expression/Materializer.cpp
source/Expression/REPL.cpp
source/Expression/UserExpression.cpp
source/Expression/UtilityFunction.cpp
source/Host/android/HostInfoAndroid.cpp
source/Host/android/LibcGlue.cpp
source/Host/common/Editline.cpp
source/Host/common/File.cpp
source/Host/common/Host.cpp
source/Host/common/HostInfoBase.cpp
source/Host/common/MainLoop.cpp
source/Host/common/NativeBreakpointList.cpp
source/Host/common/NativeProcessProtocol.cpp
source/Host/common/NativeRegisterContext.cpp
source/Host/common/PseudoTerminal.cpp
source/Host/common/Socket.cpp
source/Host/common/SocketAddress.cpp
source/Host/common/SoftwareBreakpoint.cpp
source/Host/common/Symbols.cpp
source/Host/common/TCPSocket.cpp
source/Host/common/TaskPool.cpp
source/Host/common/Terminal.cpp
source/Host/common/ThreadLauncher.cpp
source/Host/common/UDPSocket.cpp
source/Host/common/XML.cpp
source/Host/freebsd/Host.cpp
source/Host/linux/Host.cpp
source/Host/linux/HostInfoLinux.cpp
source/Host/macosx/Symbols.cpp
source/Host/macosx/cfcpp/CFCMutableDictionary.cpp
source/Host/macosx/cfcpp/CFCString.cpp
source/Host/netbsd/Host.cpp
source/Host/posix/ConnectionFileDescriptorPosix.cpp
source/Host/posix/DomainSocket.cpp
source/Host/posix/HostInfoPosix.cpp
source/Host/posix/HostProcessPosix.cpp
source/Host/posix/PipePosix.cpp
source/Host/posix/ProcessLauncherPosixFork.cpp
source/Host/windows/ConnectionGenericFileWindows.cpp
source/Host/windows/EditLineWin.cpp
source/Host/windows/FileSystem.cpp
source/Host/windows/Host.cpp
source/Host/windows/HostInfoWindows.cpp
source/Host/windows/HostProcessWindows.cpp
source/Host/windows/PipeWindows.cpp
source/Host/windows/ProcessLauncherWindows.cpp
source/Initialization/SystemInitializerCommon.cpp
source/Interpreter/CommandAlias.cpp
source/Interpreter/CommandInterpreter.cpp
source/Interpreter/CommandObject.cpp
source/Interpreter/CommandObjectRegexCommand.cpp
source/Interpreter/CommandObjectScript.cpp
source/Interpreter/CommandReturnObject.cpp
source/Interpreter/OptionArgParser.cpp
source/Interpreter/OptionGroupBoolean.cpp
source/Interpreter/OptionGroupFormat.cpp
source/Interpreter/OptionGroupValueObjectDisplay.cpp
source/Interpreter/OptionGroupVariable.cpp
source/Interpreter/OptionValue.cpp
source/Interpreter/OptionValueDictionary.cpp
source/Interpreter/OptionValueFileSpec.cpp
source/Interpreter/OptionValueFormatEntity.cpp
source/Interpreter/OptionValuePathMappings.cpp
source/Interpreter/OptionValueProperties.cpp
source/Interpreter/OptionValueSInt64.cpp
source/Interpreter/Options.cpp
source/Interpreter/Property.cpp
source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp
source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp
source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp
source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp
source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp
source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp
source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp
source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
source/Plugins/Architecture/Arm/ArchitectureArm.cpp
source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp
source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp
source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
source/Plugins/ExpressionParser/Go/GoUserExpression.cpp
source/Plugins/Instruction/ARM/EmulateInstructionARM.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/MainThreadChecker/MainThreadCheckerRuntime.cpp
source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp
source/Plugins/Language/CPlusPlus/BlockPointer.cpp
source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
source/Plugins/Language/CPlusPlus/LibCxx.cpp
source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp
source/Plugins/Language/CPlusPlus/LibCxxList.cpp
source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
source/Plugins/Language/ObjC/Cocoa.cpp
source/Plugins/Language/ObjC/CoreMedia.cpp
source/Plugins/Language/ObjC/NSError.cpp
source/Plugins/Language/ObjC/NSException.cpp
source/Plugins/Language/ObjC/NSString.cpp
source/Plugins/Language/ObjC/ObjCLanguage.cpp
source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.cpp
source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.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/RenderScriptExpressionOpts.cpp
source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
source/Plugins/ObjectFile/ELF/ELFHeader.cpp
source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
(229 more files...)
More information about the lldb-commits
mailing list