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/Target/SectionLoadHistory.cpp b/lldb/source/Target/SectionLoadHistory.cpp
index 740f48b..5844da5 100644
--- a/lldb/source/Target/SectionLoadHistory.cpp
+++ b/lldb/source/Target/SectionLoadHistory.cpp
@@ -43,13 +43,12 @@
if (!m_stop_id_to_section_load_list.empty()) {
if (read_only) {
// The section load list is for reading data only so we don't need to
- // create
- // a new SectionLoadList for the current stop ID, just return the section
- // load list for the stop ID that is equal to or less than the current
- // stop ID
+ // create a new SectionLoadList for the current stop ID, just return the
+ // section load list for the stop ID that is equal to or less than the
+ // current stop ID
if (stop_id == eStopIDNow) {
- // If we are asking for the latest and greatest value, it is always
- // at the end of our list because that will be the highest stop ID.
+ // If we are asking for the latest and greatest value, it is always at
+ // the end of our list because that will be the highest stop ID.
StopIDToSectionLoadList::reverse_iterator rpos =
m_stop_id_to_section_load_list.rbegin();
return rpos->second.get();
@@ -70,10 +69,8 @@
assert(stop_id != eStopIDNow);
// We are updating the section load list (not read only), so if the stop
- // ID
- // passed in isn't the same as the last stop ID in our collection, then
- // create
- // a new node using the current stop ID
+ // ID passed in isn't the same as the last stop ID in our collection,
+ // then create a new node using the current stop ID
StopIDToSectionLoadList::iterator pos =
m_stop_id_to_section_load_list.lower_bound(stop_id);
if (pos != m_stop_id_to_section_load_list.end() &&