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/Symbol/Declaration.cpp | |
parent | d5aa73376966339caad04013510626ec2e42c760 (diff) | |
download | llvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.bz2 |
*** 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/Symbol/Declaration.cpp')
-rw-r--r-- | lldb/source/Symbol/Declaration.cpp | 138 |
1 files changed, 59 insertions, 79 deletions
diff --git a/lldb/source/Symbol/Declaration.cpp b/lldb/source/Symbol/Declaration.cpp index c72ca04..5d1dbde 100644 --- a/lldb/source/Symbol/Declaration.cpp +++ b/lldb/source/Symbol/Declaration.cpp @@ -12,106 +12,86 @@ using namespace lldb_private; -void -Declaration::Dump(Stream *s, bool show_fullpaths) const -{ - if (m_file) - { - *s << ", decl = "; - if (show_fullpaths) - *s << m_file; - else - *s << m_file.GetFilename(); - if (m_line > 0) - s->Printf(":%u", m_line); -#ifdef LLDB_ENABLE_DECLARATION_COLUMNS - if (m_column > 0) - s->Printf(":%u", m_column); -#endif - } +void Declaration::Dump(Stream *s, bool show_fullpaths) const { + if (m_file) { + *s << ", decl = "; + if (show_fullpaths) + *s << m_file; else - { - if (m_line > 0) - { - s->Printf(", line = %u", m_line); + *s << m_file.GetFilename(); + if (m_line > 0) + s->Printf(":%u", m_line); #ifdef LLDB_ENABLE_DECLARATION_COLUMNS - if (m_column > 0) - s->Printf(":%u", m_column); + if (m_column > 0) + s->Printf(":%u", m_column); #endif - } + } else { + if (m_line > 0) { + s->Printf(", line = %u", m_line); #ifdef LLDB_ENABLE_DECLARATION_COLUMNS - else if (m_column > 0) - s->Printf(", column = %u", m_column); + if (m_column > 0) + s->Printf(":%u", m_column); #endif } +#ifdef LLDB_ENABLE_DECLARATION_COLUMNS + else if (m_column > 0) + s->Printf(", column = %u", m_column); +#endif + } } -bool -Declaration::DumpStopContext (Stream *s, bool show_fullpaths) const -{ - if (m_file) - { - if (show_fullpaths || s->GetVerbose()) - *s << m_file; - else - m_file.GetFilename().Dump(s); +bool Declaration::DumpStopContext(Stream *s, bool show_fullpaths) const { + if (m_file) { + if (show_fullpaths || s->GetVerbose()) + *s << m_file; + else + m_file.GetFilename().Dump(s); - if (m_line > 0) - s->Printf(":%u", m_line); + if (m_line > 0) + s->Printf(":%u", m_line); #ifdef LLDB_ENABLE_DECLARATION_COLUMNS - if (m_column > 0) - s->Printf(":%u", m_column); + if (m_column > 0) + s->Printf(":%u", m_column); #endif - return true; - } - else if (m_line > 0) - { - s->Printf(" line %u", m_line); + return true; + } else if (m_line > 0) { + s->Printf(" line %u", m_line); #ifdef LLDB_ENABLE_DECLARATION_COLUMNS - if (m_column > 0) - s->Printf(":%u", m_column); + if (m_column > 0) + s->Printf(":%u", m_column); #endif - return true; - } - return false; + return true; + } + return false; } -size_t -Declaration::MemorySize() const -{ - return sizeof(Declaration); -} +size_t Declaration::MemorySize() const { return sizeof(Declaration); } -int -Declaration::Compare(const Declaration& a, const Declaration& b) -{ - int result = FileSpec::Compare(a.m_file, b.m_file, true); - if (result) - return result; - if (a.m_line < b.m_line) - return -1; - else if (a.m_line > b.m_line) - return 1; +int Declaration::Compare(const Declaration &a, const Declaration &b) { + int result = FileSpec::Compare(a.m_file, b.m_file, true); + if (result) + return result; + if (a.m_line < b.m_line) + return -1; + else if (a.m_line > b.m_line) + return 1; #ifdef LLDB_ENABLE_DECLARATION_COLUMNS - if (a.m_column < b.m_column) - return -1; - else if (a.m_column > b.m_column) - return 1; + if (a.m_column < b.m_column) + return -1; + else if (a.m_column > b.m_column) + return 1; #endif - return 0; + return 0; } -bool -lldb_private::operator == (const Declaration &lhs, const Declaration &rhs) -{ +bool lldb_private::operator==(const Declaration &lhs, const Declaration &rhs) { #ifdef LLDB_ENABLE_DECLARATION_COLUMNS - if (lhs.GetColumn () == rhs.GetColumn ()) - if (lhs.GetLine () == rhs.GetLine ()) - return lhs.GetFile() == rhs.GetFile(); + if (lhs.GetColumn() == rhs.GetColumn()) + if (lhs.GetLine() == rhs.GetLine()) + return lhs.GetFile() == rhs.GetFile(); #else - if (lhs.GetLine () == rhs.GetLine ()) - return FileSpec::Equal(lhs.GetFile(),rhs.GetFile(), true, true); + if (lhs.GetLine() == rhs.GetLine()) + return FileSpec::Equal(lhs.GetFile(), rhs.GetFile(), true, true); #endif - return false; + return false; } - |