diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-04-10 20:48:55 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-04-10 20:48:55 +0000 |
commit | 8b3af63b8993e45b1783853a3fcf6f36bfbed81b (patch) | |
tree | 41759d08361beda32b90e345d8033aecd2e15088 /lldb/tools/debugserver/source/DNBDataRef.cpp | |
parent | 66b6bb1766b3e5eea56b26fc91d03f1fccbe15e4 (diff) | |
download | bcm5719-llvm-8b3af63b8993e45b1783853a3fcf6f36bfbed81b.tar.gz bcm5719-llvm-8b3af63b8993e45b1783853a3fcf6f36bfbed81b.zip |
[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
Diffstat (limited to 'lldb/tools/debugserver/source/DNBDataRef.cpp')
-rw-r--r-- | lldb/tools/debugserver/source/DNBDataRef.cpp | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/lldb/tools/debugserver/source/DNBDataRef.cpp b/lldb/tools/debugserver/source/DNBDataRef.cpp index 073591c8afe..f19c913f65d 100644 --- a/lldb/tools/debugserver/source/DNBDataRef.cpp +++ b/lldb/tools/debugserver/source/DNBDataRef.cpp @@ -16,33 +16,25 @@ #include <ctype.h> #include <libkern/OSByteOrder.h> -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- DNBDataRef::DNBDataRef() : m_start(NULL), m_end(NULL), m_swap(false), m_ptrSize(0), m_addrPCRelative(INVALID_NUB_ADDRESS), m_addrTEXT(INVALID_NUB_ADDRESS), m_addrDATA(INVALID_NUB_ADDRESS) {} -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- DNBDataRef::DNBDataRef(const uint8_t *start, size_t size, bool swap) : m_start(start), m_end(start + size), m_swap(swap), m_ptrSize(0), m_addrPCRelative(INVALID_NUB_ADDRESS), m_addrTEXT(INVALID_NUB_ADDRESS), m_addrDATA(INVALID_NUB_ADDRESS) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- DNBDataRef::~DNBDataRef() {} -//---------------------------------------------------------------------- // Get8 -//---------------------------------------------------------------------- uint8_t DNBDataRef::Get8(offset_t *offset_ptr) const { uint8_t val = 0; if (ValidOffsetForDataOfSize(*offset_ptr, sizeof(val))) { @@ -52,9 +44,7 @@ uint8_t DNBDataRef::Get8(offset_t *offset_ptr) const { return val; } -//---------------------------------------------------------------------- // Get16 -//---------------------------------------------------------------------- uint16_t DNBDataRef::Get16(offset_t *offset_ptr) const { uint16_t val = 0; if (ValidOffsetForDataOfSize(*offset_ptr, sizeof(val))) { @@ -70,9 +60,7 @@ uint16_t DNBDataRef::Get16(offset_t *offset_ptr) const { return val; } -//---------------------------------------------------------------------- // Get32 -//---------------------------------------------------------------------- uint32_t DNBDataRef::Get32(offset_t *offset_ptr) const { uint32_t val = 0; if (ValidOffsetForDataOfSize(*offset_ptr, sizeof(val))) { @@ -87,9 +75,7 @@ uint32_t DNBDataRef::Get32(offset_t *offset_ptr) const { return val; } -//---------------------------------------------------------------------- // Get64 -//---------------------------------------------------------------------- uint64_t DNBDataRef::Get64(offset_t *offset_ptr) const { uint64_t val = 0; if (ValidOffsetForDataOfSize(*offset_ptr, sizeof(val))) { @@ -104,12 +90,10 @@ uint64_t DNBDataRef::Get64(offset_t *offset_ptr) const { return val; } -//---------------------------------------------------------------------- // GetMax32 // // Used for calls when the size can vary. Fill in extra cases if they // are ever needed. -//---------------------------------------------------------------------- uint32_t DNBDataRef::GetMax32(offset_t *offset_ptr, uint32_t byte_size) const { switch (byte_size) { case 1: @@ -128,12 +112,10 @@ uint32_t DNBDataRef::GetMax32(offset_t *offset_ptr, uint32_t byte_size) const { return 0; } -//---------------------------------------------------------------------- // GetMax64 // // Used for calls when the size can vary. Fill in extra cases if they // are ever needed. -//---------------------------------------------------------------------- uint64_t DNBDataRef::GetMax64(offset_t *offset_ptr, uint32_t size) const { switch (size) { case 1: @@ -155,20 +137,16 @@ uint64_t DNBDataRef::GetMax64(offset_t *offset_ptr, uint32_t size) const { return 0; } -//---------------------------------------------------------------------- // GetPointer // // Extract a pointer value from the buffer. The pointer size must be // set prior to using this using one of the SetPointerSize functions. -//---------------------------------------------------------------------- uint64_t DNBDataRef::GetPointer(offset_t *offset_ptr) const { // Must set pointer size prior to using this call assert(m_ptrSize != 0); return GetMax64(offset_ptr, m_ptrSize); } -//---------------------------------------------------------------------- // GetCStr -//---------------------------------------------------------------------- const char *DNBDataRef::GetCStr(offset_t *offset_ptr, uint32_t fixed_length) const { const char *s = NULL; @@ -184,9 +162,7 @@ const char *DNBDataRef::GetCStr(offset_t *offset_ptr, return s; } -//---------------------------------------------------------------------- // GetData -//---------------------------------------------------------------------- const uint8_t *DNBDataRef::GetData(offset_t *offset_ptr, uint32_t length) const { const uint8_t *data = NULL; @@ -197,9 +173,7 @@ const uint8_t *DNBDataRef::GetData(offset_t *offset_ptr, return data; } -//---------------------------------------------------------------------- // Get_ULEB128 -//---------------------------------------------------------------------- uint64_t DNBDataRef::Get_ULEB128(offset_t *offset_ptr) const { uint64_t result = 0; if (m_start < m_end) { @@ -222,9 +196,7 @@ uint64_t DNBDataRef::Get_ULEB128(offset_t *offset_ptr) const { return result; } -//---------------------------------------------------------------------- // Get_SLEB128 -//---------------------------------------------------------------------- int64_t DNBDataRef::Get_SLEB128(offset_t *offset_ptr) const { int64_t result = 0; @@ -254,11 +226,9 @@ int64_t DNBDataRef::Get_SLEB128(offset_t *offset_ptr) const { return result; } -//---------------------------------------------------------------------- // Skip_LEB128 // // Skips past ULEB128 and SLEB128 numbers (just updates the offset) -//---------------------------------------------------------------------- void DNBDataRef::Skip_LEB128(offset_t *offset_ptr) const { if (m_start < m_end) { const uint8_t *start = m_start + *offset_ptr; |