[NFC] Remove ASCII lines from comments

A lot of comments in LLDB are surrounded by an ASCII line to delimit the
begging and end of the comment.

Its use is not really consistent across the code base, sometimes the
lines are longer, sometimes they are shorter and sometimes they are
omitted. Furthermore, it looks kind of weird with the 80 column limit,
where the comment actually extends past the line, but not by much.
Furthermore, when /// is used for Doxygen comments, it looks
particularly odd. And when // is used, it incorrectly gives the
impression that it's actually a Doxygen comment.

I assume these lines were added to improve distinguishing between
comments and code. However, given that todays editors and IDEs do a
great job at highlighting comments, I think it's worth to drop this for
the sake of consistency. The alternative is fixing all the
inconsistencies, which would create a lot more churn.

Differential revision: https://reviews.llvm.org/D60508

llvm-svn: 358135
This commit is contained in:
Jonas Devlieghere
2019-04-10 20:48:55 +00:00
parent 66b6bb1766
commit 8b3af63b89
889 changed files with 0 additions and 10287 deletions

View File

@@ -29,9 +29,7 @@ Stream::Stream()
: m_flags(0), m_addr_size(4), m_byte_order(endian::InlHostByteOrder()),
m_indent_level(0), m_forwarder(*this) {}
//------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------
Stream::~Stream() {}
ByteOrder Stream::SetByteOrder(ByteOrder byte_order) {
@@ -40,14 +38,10 @@ ByteOrder Stream::SetByteOrder(ByteOrder byte_order) {
return old_byte_order;
}
//------------------------------------------------------------------
// Put an offset "uval" out to the stream using the printf format in "format".
//------------------------------------------------------------------
void Stream::Offset(uint32_t uval, const char *format) { Printf(format, uval); }
//------------------------------------------------------------------
// Put an SLEB128 "uval" out to the stream using the printf format in "format".
//------------------------------------------------------------------
size_t Stream::PutSLEB128(int64_t sval) {
if (m_flags.Test(eBinary))
return llvm::encodeSLEB128(sval, m_forwarder);
@@ -55,9 +49,7 @@ size_t Stream::PutSLEB128(int64_t sval) {
return Printf("0x%" PRIi64, sval);
}
//------------------------------------------------------------------
// Put an ULEB128 "uval" out to the stream using the printf format in "format".
//------------------------------------------------------------------
size_t Stream::PutULEB128(uint64_t uval) {
if (m_flags.Test(eBinary))
return llvm::encodeULEB128(uval, m_forwarder);
@@ -65,9 +57,7 @@ size_t Stream::PutULEB128(uint64_t uval) {
return Printf("0x%" PRIx64, uval);
}
//------------------------------------------------------------------
// Print a raw NULL terminated C string to the stream.
//------------------------------------------------------------------
size_t Stream::PutCString(llvm::StringRef str) {
size_t bytes_written = 0;
bytes_written = Write(str.data(), str.size());
@@ -78,18 +68,14 @@ size_t Stream::PutCString(llvm::StringRef str) {
return bytes_written;
}
//------------------------------------------------------------------
// Print a double quoted NULL terminated C string to the stream using the
// printf format in "format".
//------------------------------------------------------------------
void Stream::QuotedCString(const char *cstr, const char *format) {
Printf(format, cstr);
}
//------------------------------------------------------------------
// Put an address "addr" out to the stream with optional prefix and suffix
// strings.
//------------------------------------------------------------------
void Stream::Address(uint64_t addr, uint32_t addr_size, const char *prefix,
const char *suffix) {
if (prefix == nullptr)
@@ -101,10 +87,8 @@ void Stream::Address(uint64_t addr, uint32_t addr_size, const char *prefix,
Printf("%s0x%0*" PRIx64 "%s", prefix, addr_size * 2, (uint64_t)addr, suffix);
}
//------------------------------------------------------------------
// Put an address range out to the stream with optional prefix and suffix
// strings.
//------------------------------------------------------------------
void Stream::AddressRange(uint64_t lo_addr, uint64_t hi_addr,
uint32_t addr_size, const char *prefix,
const char *suffix) {
@@ -118,9 +102,7 @@ void Stream::AddressRange(uint64_t lo_addr, uint64_t hi_addr,
size_t Stream::PutChar(char ch) { return Write(&ch, 1); }
//------------------------------------------------------------------
// Print some formatted output to the stream.
//------------------------------------------------------------------
size_t Stream::Printf(const char *format, ...) {
va_list args;
va_start(args, format);
@@ -129,9 +111,7 @@ size_t Stream::Printf(const char *format, ...) {
return result;
}
//------------------------------------------------------------------
// Print some formatted output to the stream.
//------------------------------------------------------------------
size_t Stream::PrintfVarArg(const char *format, va_list args) {
llvm::SmallString<1024> buf;
VASprintf(buf, format, args);
@@ -143,15 +123,11 @@ size_t Stream::PrintfVarArg(const char *format, va_list args) {
return Write(buf.c_str(), length);
}
//------------------------------------------------------------------
// Print and End of Line character to the stream
//------------------------------------------------------------------
size_t Stream::EOL() { return PutChar('\n'); }
//------------------------------------------------------------------
// Indent the current line using the current indentation level and print an
// optional string following the indentation spaces.
//------------------------------------------------------------------
size_t Stream::Indent(const char *s) {
return Printf("%*.*s%s", m_indent_level, m_indent_level, "", s ? s : "");
}
@@ -161,17 +137,13 @@ size_t Stream::Indent(llvm::StringRef str) {
str.str().c_str());
}
//------------------------------------------------------------------
// Stream a character "ch" out to this stream.
//------------------------------------------------------------------
Stream &Stream::operator<<(char ch) {
PutChar(ch);
return *this;
}
//------------------------------------------------------------------
// Stream the NULL terminated C string out to this stream.
//------------------------------------------------------------------
Stream &Stream::operator<<(const char *s) {
Printf("%s", s);
return *this;
@@ -182,96 +154,70 @@ Stream &Stream::operator<<(llvm::StringRef str) {
return *this;
}
//------------------------------------------------------------------
// Stream the pointer value out to this stream.
//------------------------------------------------------------------
Stream &Stream::operator<<(const void *p) {
Printf("0x%.*tx", (int)sizeof(const void *) * 2, (ptrdiff_t)p);
return *this;
}
//------------------------------------------------------------------
// Stream a uint8_t "uval" out to this stream.
//------------------------------------------------------------------
Stream &Stream::operator<<(uint8_t uval) {
PutHex8(uval);
return *this;
}
//------------------------------------------------------------------
// Stream a uint16_t "uval" out to this stream.
//------------------------------------------------------------------
Stream &Stream::operator<<(uint16_t uval) {
PutHex16(uval, m_byte_order);
return *this;
}
//------------------------------------------------------------------
// Stream a uint32_t "uval" out to this stream.
//------------------------------------------------------------------
Stream &Stream::operator<<(uint32_t uval) {
PutHex32(uval, m_byte_order);
return *this;
}
//------------------------------------------------------------------
// Stream a uint64_t "uval" out to this stream.
//------------------------------------------------------------------
Stream &Stream::operator<<(uint64_t uval) {
PutHex64(uval, m_byte_order);
return *this;
}
//------------------------------------------------------------------
// Stream a int8_t "sval" out to this stream.
//------------------------------------------------------------------
Stream &Stream::operator<<(int8_t sval) {
Printf("%i", (int)sval);
return *this;
}
//------------------------------------------------------------------
// Stream a int16_t "sval" out to this stream.
//------------------------------------------------------------------
Stream &Stream::operator<<(int16_t sval) {
Printf("%i", (int)sval);
return *this;
}
//------------------------------------------------------------------
// Stream a int32_t "sval" out to this stream.
//------------------------------------------------------------------
Stream &Stream::operator<<(int32_t sval) {
Printf("%i", (int)sval);
return *this;
}
//------------------------------------------------------------------
// Stream a int64_t "sval" out to this stream.
//------------------------------------------------------------------
Stream &Stream::operator<<(int64_t sval) {
Printf("%" PRIi64, sval);
return *this;
}
//------------------------------------------------------------------
// Get the current indentation level
//------------------------------------------------------------------
int Stream::GetIndentLevel() const { return m_indent_level; }
//------------------------------------------------------------------
// Set the current indentation level
//------------------------------------------------------------------
void Stream::SetIndentLevel(int indent_level) { m_indent_level = indent_level; }
//------------------------------------------------------------------
// Increment the current indentation level
//------------------------------------------------------------------
void Stream::IndentMore(int amount) { m_indent_level += amount; }
//------------------------------------------------------------------
// Decrement the current indentation level
//------------------------------------------------------------------
void Stream::IndentLess(int amount) {
if (m_indent_level >= amount)
m_indent_level -= amount;
@@ -279,29 +225,19 @@ void Stream::IndentLess(int amount) {
m_indent_level = 0;
}
//------------------------------------------------------------------
// Get the address size in bytes
//------------------------------------------------------------------
uint32_t Stream::GetAddressByteSize() const { return m_addr_size; }
//------------------------------------------------------------------
// Set the address size in bytes
//------------------------------------------------------------------
void Stream::SetAddressByteSize(uint32_t addr_size) { m_addr_size = addr_size; }
//------------------------------------------------------------------
// The flags get accessor
//------------------------------------------------------------------
Flags &Stream::GetFlags() { return m_flags; }
//------------------------------------------------------------------
// The flags const get accessor
//------------------------------------------------------------------
const Flags &Stream::GetFlags() const { return m_flags; }
//------------------------------------------------------------------
// The byte order get accessor
//------------------------------------------------------------------
lldb::ByteOrder Stream::GetByteOrder() const { return m_byte_order; }