summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp
diff options
context:
space:
mode:
authorKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
committerKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
commitb9c1b51e45b845debb76d8658edabca70ca56079 (patch)
treedfcb5a13ef2b014202340f47036da383eaee74aa /lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp
parentd5aa73376966339caad04013510626ec2e42c760 (diff)
downloadbcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz
bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp179
1 files changed, 79 insertions, 100 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp
index 4a176bb8aad..45498590236 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp
@@ -14,119 +14,98 @@
using namespace lldb_private;
using namespace std;
-DWARFDebugMacinfoEntry::DWARFDebugMacinfoEntry() :
- m_type_code(0),
- m_line(0),
- m_op2()
-{
- m_op2.cstr = NULL;
+DWARFDebugMacinfoEntry::DWARFDebugMacinfoEntry()
+ : m_type_code(0), m_line(0), m_op2() {
+ m_op2.cstr = NULL;
}
-DWARFDebugMacinfoEntry::~DWARFDebugMacinfoEntry()
-{
+DWARFDebugMacinfoEntry::~DWARFDebugMacinfoEntry() {}
+
+const char *DWARFDebugMacinfoEntry::GetCString() const {
+ switch (m_type_code) {
+ case 0:
+ case DW_MACINFO_start_file:
+ case DW_MACINFO_end_file:
+ return NULL;
+ default:
+ break;
+ }
+ return m_op2.cstr;
}
-const char*
-DWARFDebugMacinfoEntry::GetCString() const
-{
- switch (m_type_code)
- {
- case 0:
- case DW_MACINFO_start_file:
- case DW_MACINFO_end_file:
- return NULL;
- default:
- break;
- }
- return m_op2.cstr;
-}
+void DWARFDebugMacinfoEntry::Dump(Stream *s) const {
+ if (m_type_code) {
+ s->PutCString(DW_MACINFO_value_to_name(m_type_code));
+ switch (m_type_code) {
+ case DW_MACINFO_define:
+ s->Printf(" line:%u #define %s\n", (uint32_t)m_line, m_op2.cstr);
+ break;
+ case DW_MACINFO_undef:
+ s->Printf(" line:%u #undef %s\n", (uint32_t)m_line, m_op2.cstr);
+ break;
-void
-DWARFDebugMacinfoEntry::Dump(Stream *s) const
-{
- if (m_type_code)
- {
- s->PutCString(DW_MACINFO_value_to_name(m_type_code));
-
- switch (m_type_code)
- {
- case DW_MACINFO_define:
- s->Printf(" line:%u #define %s\n", (uint32_t)m_line, m_op2.cstr);
- break;
-
- case DW_MACINFO_undef:
- s->Printf(" line:%u #undef %s\n", (uint32_t)m_line, m_op2.cstr);
- break;
-
- default:
- s->Printf(" line:%u str: '%s'\n", (uint32_t)m_line, m_op2.cstr);
- break;
+ default:
+ s->Printf(" line:%u str: '%s'\n", (uint32_t)m_line, m_op2.cstr);
+ break;
- case DW_MACINFO_start_file:
- s->Printf(" line:%u file index: '%u'\n", (uint32_t)m_line, (uint32_t)m_op2.file_idx);
- break;
+ case DW_MACINFO_start_file:
+ s->Printf(" line:%u file index: '%u'\n", (uint32_t)m_line,
+ (uint32_t)m_op2.file_idx);
+ break;
- case DW_MACINFO_end_file:
- break;
- }
- }
- else
- {
- s->PutCString(" END\n");
+ case DW_MACINFO_end_file:
+ break;
}
+ } else {
+ s->PutCString(" END\n");
+ }
}
+bool DWARFDebugMacinfoEntry::Extract(const DWARFDataExtractor &mac_info_data,
+ lldb::offset_t *offset_ptr) {
+ if (mac_info_data.ValidOffset(*offset_ptr)) {
+ m_type_code = mac_info_data.GetU8(offset_ptr);
+
+ switch (m_type_code) {
+
+ case DW_MACINFO_define:
+ case DW_MACINFO_undef:
+ // 2 operands:
+ // Arg 1: operand encodes the line number of the source line on which
+ // the relevant defining or undefining pre-processor directives
+ // appeared.
+ m_line = mac_info_data.GetULEB128(offset_ptr);
+ // Arg 2: define string
+ m_op2.cstr = mac_info_data.GetCStr(offset_ptr);
+ break;
-bool
-DWARFDebugMacinfoEntry::Extract(const DWARFDataExtractor& mac_info_data, lldb::offset_t* offset_ptr)
-{
- if (mac_info_data.ValidOffset(*offset_ptr))
- {
- m_type_code = mac_info_data.GetU8(offset_ptr);
-
- switch (m_type_code)
- {
-
- case DW_MACINFO_define:
- case DW_MACINFO_undef:
- // 2 operands:
- // Arg 1: operand encodes the line number of the source line on which
- // the relevant defining or undefining pre-processor directives
- // appeared.
- m_line = mac_info_data.GetULEB128(offset_ptr);
- // Arg 2: define string
- m_op2.cstr = mac_info_data.GetCStr(offset_ptr);
- break;
-
- case DW_MACINFO_start_file:
- // 2 operands:
- // Op 1: line number of the source line on which the inclusion
- // pre-processor directive occurred.
- m_line = mac_info_data.GetULEB128(offset_ptr);
- // Op 2: a source file name index to a file number in the statement
- // information table for the relevant compilation unit.
- m_op2.file_idx = mac_info_data.GetULEB128(offset_ptr);
- break;
-
- case 0: // End of list
- case DW_MACINFO_end_file:
- // No operands
- m_line = DW_INVALID_OFFSET;
- m_op2.cstr = NULL;
- break;
- default:
- // Vendor specific entries always have a ULEB128 and a string
- m_line = mac_info_data.GetULEB128(offset_ptr);
- m_op2.cstr = mac_info_data.GetCStr(offset_ptr);
- break;
- }
- return true;
+ case DW_MACINFO_start_file:
+ // 2 operands:
+ // Op 1: line number of the source line on which the inclusion
+ // pre-processor directive occurred.
+ m_line = mac_info_data.GetULEB128(offset_ptr);
+ // Op 2: a source file name index to a file number in the statement
+ // information table for the relevant compilation unit.
+ m_op2.file_idx = mac_info_data.GetULEB128(offset_ptr);
+ break;
+
+ case 0: // End of list
+ case DW_MACINFO_end_file:
+ // No operands
+ m_line = DW_INVALID_OFFSET;
+ m_op2.cstr = NULL;
+ break;
+ default:
+ // Vendor specific entries always have a ULEB128 and a string
+ m_line = mac_info_data.GetULEB128(offset_ptr);
+ m_op2.cstr = mac_info_data.GetCStr(offset_ptr);
+ break;
}
- else
- m_type_code = 0;
+ return true;
+ } else
+ m_type_code = 0;
- return false;
+ return false;
}
-
OpenPOWER on IntegriCloud