diff options
author | Adrian Prantl <aprantl@apple.com> | 2018-04-30 16:49:04 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2018-04-30 16:49:04 +0000 |
commit | 05097246f352eca76207c9ebb08656c88bdf751a (patch) | |
tree | bfc4ec8250a939aaf4ade6fc6c528726183e5367 /lldb/source/Core/PluginManager.cpp | |
parent | add59c052dd6768fd54431e6a3bf045e7f25cb59 (diff) | |
download | bcm5719-llvm-05097246f352eca76207c9ebb08656c88bdf751a.tar.gz bcm5719-llvm-05097246f352eca76207c9ebb08656c88bdf751a.zip |
Reflow paragraphs in comments.
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 = ""
comment = re.compile(r'^( *//) ([^ ].*)$')
special = re.compile(r'^((([A-Z]+[: ])|([0-9]+ )).*)|(.*;)$')
for line in f:
match = comment.match(line)
if match and not special.match(match.group(2)):
# 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
if text:
filled = textwrap.wrap(text, width=(78-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])
Differential Revision: https://reviews.llvm.org/D46144
llvm-svn: 331197
Diffstat (limited to 'lldb/source/Core/PluginManager.cpp')
-rw-r--r-- | lldb/source/Core/PluginManager.cpp | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/lldb/source/Core/PluginManager.cpp b/lldb/source/Core/PluginManager.cpp index 1f02b401c7e..44a37a0a62d 100644 --- a/lldb/source/Core/PluginManager.cpp +++ b/lldb/source/Core/PluginManager.cpp @@ -96,8 +96,8 @@ LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft, Status error; namespace fs = llvm::sys::fs; - // If we have a regular file, a symbolic link or unknown file type, try - // and process the file. We must handle unknown as sometimes the directory + // If we have a regular file, a symbolic link or unknown file type, try and + // process the file. We must handle unknown as sometimes the directory // enumeration might be enumerating a file system that doesn't have correct // file type information. if (ft == fs::file_type::regular_file || ft == fs::file_type::symlink_file || @@ -128,17 +128,14 @@ LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft, plugin_info.library.getAddressOfSymbol("LLDBPluginTerminate")); } else { // The initialize function returned FALSE which means the plug-in - // might not be - // compatible, or might be too new or too old, or might not want to - // run on this - // machine. Set it to a default-constructed instance to invalidate - // it. + // might not be compatible, or might be too new or too old, or might + // not want to run on this machine. Set it to a default-constructed + // instance to invalidate it. plugin_info = PluginInfo(); } - // Regardless of success or failure, cache the plug-in load - // in our plug-in info so we don't try to load it again and - // again. + // Regardless of success or failure, cache the plug-in load in our + // plug-in info so we don't try to load it again and again. SetPluginInfo(plugin_file_spec, plugin_info); return FileSpec::eEnumerateDirectoryResultNext; @@ -148,9 +145,9 @@ LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft, if (ft == fs::file_type::directory_file || ft == fs::file_type::symlink_file || ft == fs::file_type::type_unknown) { - // Try and recurse into anything that a directory or symbolic link. - // We must also do this for unknown as sometimes the directory enumeration - // might be enumerating a file system that doesn't have correct file type + // Try and recurse into anything that a directory or symbolic link. We must + // also do this for unknown as sometimes the directory enumeration might be + // enumerating a file system that doesn't have correct file type // information. return FileSpec::eEnumerateDirectoryResultEnter; } @@ -187,8 +184,8 @@ void PluginManager::Terminate() { PluginTerminateMap::const_iterator pos, end = plugin_map.end(); for (pos = plugin_map.begin(); pos != end; ++pos) { - // Call the plug-in "void LLDBPluginTerminate (void)" function if there - // is one (if the symbol was not nullptr). + // Call the plug-in "void LLDBPluginTerminate (void)" function if there is + // one (if the symbol was not nullptr). if (pos->second.library.isValid()) { if (pos->second.plugin_term_callback) pos->second.plugin_term_callback(); @@ -2397,8 +2394,8 @@ static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPlugins( } // This is deprecated way to register plugin specific settings. e.g. -// "<plugin_type_name>.plugin.<plugin_type_desc>.SETTINGNAME" -// and Platform generic settings would be under "platform.SETTINGNAME". +// "<plugin_type_name>.plugin.<plugin_type_desc>.SETTINGNAME" and Platform +// generic settings would be under "platform.SETTINGNAME". static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPluginsOldStyle( Debugger &debugger, const ConstString &plugin_type_name, const ConstString &plugin_type_desc, bool can_create) { |