mirror of
https://github.com/intel/llvm.git
synced 2026-01-21 20:53:29 +08:00
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
This commit is contained in:
@@ -236,8 +236,8 @@ bool ObjectFilePECOFF::SetLoadAddress(Target &target, addr_t value,
|
||||
size_t sect_idx = 0;
|
||||
|
||||
for (sect_idx = 0; sect_idx < num_sections; ++sect_idx) {
|
||||
// Iterate through the object file sections to find all
|
||||
// of the sections that have SHF_ALLOC in their flag bits.
|
||||
// Iterate through the object file sections to find all of the sections
|
||||
// that have SHF_ALLOC in their flag bits.
|
||||
SectionSP section_sp(section_list->GetSectionAtIndex(sect_idx));
|
||||
if (section_sp && !section_sp->IsThreadSpecific()) {
|
||||
if (target.GetSectionLoadList().SetSectionLoadAddress(
|
||||
@@ -268,8 +268,8 @@ uint32_t ObjectFilePECOFF::GetAddressByteSize() const {
|
||||
//----------------------------------------------------------------------
|
||||
// NeedsEndianSwap
|
||||
//
|
||||
// Return true if an endian swap needs to occur when extracting data
|
||||
// from this file.
|
||||
// Return true if an endian swap needs to occur when extracting data from this
|
||||
// file.
|
||||
//----------------------------------------------------------------------
|
||||
bool ObjectFilePECOFF::NeedsEndianSwap() const {
|
||||
#if defined(__LITTLE_ENDIAN__)
|
||||
@@ -552,8 +552,8 @@ Symtab *ObjectFilePECOFF::GetSymtab() {
|
||||
// are followed by a 4-byte string table offset. Else these
|
||||
// 8 bytes contain the symbol name
|
||||
if (symtab_data.GetU32(&offset) == 0) {
|
||||
// Long string that doesn't fit into the symbol table name,
|
||||
// so now we must read the 4 byte string table offset
|
||||
// Long string that doesn't fit into the symbol table name, so
|
||||
// now we must read the 4 byte string table offset
|
||||
uint32_t strtab_offset = symtab_data.GetU32(&offset);
|
||||
symbol_name_cstr = strtab_data.PeekCStr(strtab_offset);
|
||||
symbol_name.assign(symbol_name_cstr);
|
||||
|
||||
Reference in New Issue
Block a user