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
diff --git a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
index 16de62b..d787d86 100644
--- a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
+++ b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
@@ -766,9 +766,9 @@
stream.Printf("0001-12-30 00:00:00 +0000");
return true;
}
- // this snippet of code assumes that time_t == seconds since Jan-1-1970
- // this is generally true and POSIXly happy, but might break if a library
- // vendor decides to get creative
+ // this snippet of code assumes that time_t == seconds since Jan-1-1970 this
+ // is generally true and POSIXly happy, but might break if a library vendor
+ // decides to get creative
time_t epoch = GetOSXEpoch();
epoch = epoch + (time_t)date_value;
tm *tm_date = gmtime(&epoch);
diff --git a/lldb/source/Plugins/Language/ObjC/NSError.cpp b/lldb/source/Plugins/Language/ObjC/NSError.cpp
index 4365a12..77721e2 100644
--- a/lldb/source/Plugins/Language/ObjC/NSError.cpp
+++ b/lldb/source/Plugins/Language/ObjC/NSError.cpp
@@ -177,12 +177,11 @@
private:
// the child here can be "real" (i.e. an actual child of the root) or
- // synthetized from raw memory
- // if the former, I need to store a plain pointer to it - or else a loop of
- // references will cause this entire hierarchy of values to leak
- // if the latter, then I need to store a SharedPointer to it - so that it only
- // goes away when everyone else in the cluster goes away
- // oh joy!
+ // synthetized from raw memory if the former, I need to store a plain pointer
+ // to it - or else a loop of references will cause this entire hierarchy of
+ // values to leak if the latter, then I need to store a SharedPointer to it -
+ // so that it only goes away when everyone else in the cluster goes away oh
+ // joy!
ValueObject *m_child_ptr;
ValueObjectSP m_child_sp;
};
diff --git a/lldb/source/Plugins/Language/ObjC/NSException.cpp b/lldb/source/Plugins/Language/ObjC/NSException.cpp
index 1da4f6d..c6970ef 100644
--- a/lldb/source/Plugins/Language/ObjC/NSException.cpp
+++ b/lldb/source/Plugins/Language/ObjC/NSException.cpp
@@ -171,12 +171,11 @@
private:
// the child here can be "real" (i.e. an actual child of the root) or
- // synthetized from raw memory
- // if the former, I need to store a plain pointer to it - or else a loop of
- // references will cause this entire hierarchy of values to leak
- // if the latter, then I need to store a SharedPointer to it - so that it only
- // goes away when everyone else in the cluster goes away
- // oh joy!
+ // synthetized from raw memory if the former, I need to store a plain pointer
+ // to it - or else a loop of references will cause this entire hierarchy of
+ // values to leak if the latter, then I need to store a SharedPointer to it -
+ // so that it only goes away when everyone else in the cluster goes away oh
+ // joy!
ValueObject *m_child_ptr;
ValueObjectSP m_child_sp;
};
diff --git a/lldb/source/Plugins/Language/ObjC/NSString.cpp b/lldb/source/Plugins/Language/ObjC/NSString.cpp
index 3b4edf6..0b12edb 100644
--- a/lldb/source/Plugins/Language/ObjC/NSString.cpp
+++ b/lldb/source/Plugins/Language/ObjC/NSString.cpp
@@ -256,8 +256,7 @@
uint64_t location = valobj_addr + 2 * ptr_size;
if (!has_explicit_length) {
// in this kind of string, the byte before the string content is a length
- // byte
- // so let's try and use it to handle the embedded NUL case
+ // byte so let's try and use it to handle the embedded NUL case
Status error;
explicit_length =
process_sp->ReadUnsignedIntegerFromMemory(location, 1, 0, error);
@@ -368,9 +367,7 @@
}
// this is a fairly ugly trick - pretend that the numeric value is actually a
- // char*
- // this works under a few assumptions:
- // little endian architecture
+ // char* this works under a few assumptions: little endian architecture
// sizeof(uint64_t) > g_MaxNonBitmaskedLen
if (len_bits <= g_MaxNonBitmaskedLen) {
stream.Printf("%s", prefix.c_str());
diff --git a/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp b/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp
index ea2eec7..95d2d04 100644
--- a/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp
+++ b/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp
@@ -90,9 +90,8 @@
if (name.empty())
return IsValid(strict);
- // If "strict" is true. then the method must be specified with a
- // '+' or '-' at the beginning. If "strict" is false, then the '+'
- // or '-' can be omitted
+ // If "strict" is true. then the method must be specified with a '+' or '-'
+ // at the beginning. If "strict" is false, then the '+' or '-' can be omitted
bool valid_prefix = false;
if (name.size() > 1 && (name[0] == '+' || name[0] == '-')) {
@@ -134,8 +133,8 @@
if (paren_pos) {
m_class.SetCStringWithLength(class_start, paren_pos - class_start);
} else {
- // No '(' was found in the full name, we can definitively say
- // that our category was valid (and empty).
+ // No '(' was found in the full name, we can definitively say that our
+ // category was valid (and empty).
m_category_is_valid = true;
const char *space_pos = strchr(full, ' ');
if (space_pos) {
@@ -164,8 +163,8 @@
// contain a '(', then we can also fill in the m_class
if (!m_class && strchr(m_class_category.GetCString(), '(') == nullptr) {
m_class = m_class_category;
- // No '(' was found in the full name, we can definitively say
- // that our category was valid (and empty).
+ // No '(' was found in the full name, we can definitively say that
+ // our category was valid (and empty).
m_category_is_valid = true;
}
}
@@ -796,8 +795,8 @@
objc_category_sp, lldb_private::formatters::NSTimeZoneSummaryProvider,
"NSTimeZone summary provider", ConstString("__NSTimeZone"), appkit_flags);
- // CFAbsoluteTime is actually a double rather than a pointer to an object
- // we do not care about the numeric value, since it is probably meaningless to
+ // CFAbsoluteTime is actually a double rather than a pointer to an object we
+ // do not care about the numeric value, since it is probably meaningless to
// users
appkit_flags.SetDontShowValue(true);
AddCXXSummary(objc_category_sp,