diff options
author | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
---|---|---|
committer | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
commit | b9c1b51e45b845debb76d8658edabca70ca56079 (patch) | |
tree | dfcb5a13ef2b014202340f47036da383eaee74aa /lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp | |
parent | d5aa73376966339caad04013510626ec2e42c760 (diff) | |
download | bcm5719-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/NameToDIE.cpp')
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp | 102 |
1 files changed, 44 insertions, 58 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp b/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp index fe02adbb6c8..df185267c08 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp @@ -9,9 +9,9 @@ #include "NameToDIE.h" #include "lldb/Core/ConstString.h" +#include "lldb/Core/RegularExpression.h" #include "lldb/Core/Stream.h" #include "lldb/Core/StreamString.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Symbol/ObjectFile.h" #include "DWARFCompileUnit.h" @@ -22,75 +22,61 @@ using namespace lldb; using namespace lldb_private; -void -NameToDIE::Finalize() -{ - m_map.Sort (); - m_map.SizeToFit (); +void NameToDIE::Finalize() { + m_map.Sort(); + m_map.SizeToFit(); } -void -NameToDIE::Insert (const ConstString& name, const DIERef& die_ref) -{ - m_map.Append(name.GetCString(), die_ref); +void NameToDIE::Insert(const ConstString &name, const DIERef &die_ref) { + m_map.Append(name.GetCString(), die_ref); } -size_t -NameToDIE::Find (const ConstString &name, DIEArray &info_array) const -{ - return m_map.GetValues (name.GetCString(), info_array); +size_t NameToDIE::Find(const ConstString &name, DIEArray &info_array) const { + return m_map.GetValues(name.GetCString(), info_array); } -size_t -NameToDIE::Find (const RegularExpression& regex, DIEArray &info_array) const -{ - return m_map.GetValues (regex, info_array); +size_t NameToDIE::Find(const RegularExpression ®ex, + DIEArray &info_array) const { + return m_map.GetValues(regex, info_array); } -size_t -NameToDIE::FindAllEntriesForCompileUnit (dw_offset_t cu_offset, DIEArray &info_array) const -{ - const size_t initial_size = info_array.size(); - const uint32_t size = m_map.GetSize(); - for (uint32_t i=0; i<size; ++i) - { - const DIERef& die_ref = m_map.GetValueAtIndexUnchecked(i); - if (cu_offset == die_ref.cu_offset) - info_array.push_back (die_ref); - } - return info_array.size() - initial_size; +size_t NameToDIE::FindAllEntriesForCompileUnit(dw_offset_t cu_offset, + DIEArray &info_array) const { + const size_t initial_size = info_array.size(); + const uint32_t size = m_map.GetSize(); + for (uint32_t i = 0; i < size; ++i) { + const DIERef &die_ref = m_map.GetValueAtIndexUnchecked(i); + if (cu_offset == die_ref.cu_offset) + info_array.push_back(die_ref); + } + return info_array.size() - initial_size; } -void -NameToDIE::Dump (Stream *s) -{ - const uint32_t size = m_map.GetSize(); - for (uint32_t i=0; i<size; ++i) - { - const char *cstr = m_map.GetCStringAtIndex(i); - const DIERef& die_ref = m_map.GetValueAtIndexUnchecked(i); - s->Printf("%p: {0x%8.8x/0x%8.8x} \"%s\"\n", (const void*) cstr, die_ref.cu_offset, die_ref.die_offset, cstr); - } +void NameToDIE::Dump(Stream *s) { + const uint32_t size = m_map.GetSize(); + for (uint32_t i = 0; i < size; ++i) { + const char *cstr = m_map.GetCStringAtIndex(i); + const DIERef &die_ref = m_map.GetValueAtIndexUnchecked(i); + s->Printf("%p: {0x%8.8x/0x%8.8x} \"%s\"\n", (const void *)cstr, + die_ref.cu_offset, die_ref.die_offset, cstr); + } } -void -NameToDIE::ForEach (std::function <bool(const char *name, const DIERef& die_ref)> const &callback) const -{ - const uint32_t size = m_map.GetSize(); - for (uint32_t i=0; i<size; ++i) - { - if (!callback(m_map.GetCStringAtIndexUnchecked(i), m_map.GetValueAtIndexUnchecked (i))) - break; - } +void NameToDIE::ForEach( + std::function<bool(const char *name, const DIERef &die_ref)> const + &callback) const { + const uint32_t size = m_map.GetSize(); + for (uint32_t i = 0; i < size; ++i) { + if (!callback(m_map.GetCStringAtIndexUnchecked(i), + m_map.GetValueAtIndexUnchecked(i))) + break; + } } -void -NameToDIE::Append (const NameToDIE& other) -{ - const uint32_t size = other.m_map.GetSize(); - for (uint32_t i = 0; i < size; ++i) - { - m_map.Append(other.m_map.GetCStringAtIndexUnchecked (i), - other.m_map.GetValueAtIndexUnchecked (i)); - } +void NameToDIE::Append(const NameToDIE &other) { + const uint32_t size = other.m_map.GetSize(); + for (uint32_t i = 0; i < size; ++i) { + m_map.Append(other.m_map.GetCStringAtIndexUnchecked(i), + other.m_map.GetValueAtIndexUnchecked(i)); + } } |