aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Utility/Range.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/Utility/Range.cpp
parentd5aa73376966339caad04013510626ec2e42c760 (diff)
downloadllvm-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/Utility/Range.cpp')
-rw-r--r--lldb/source/Utility/Range.cpp117
1 files changed, 44 insertions, 73 deletions
diff --git a/lldb/source/Utility/Range.cpp b/lldb/source/Utility/Range.cpp
index 158d1e7..95f00e5 100644
--- a/lldb/source/Utility/Range.cpp
+++ b/lldb/source/Utility/Range.cpp
@@ -1,4 +1,5 @@
-//===--------------------- Range.cpp -----------------------------*- C++ -*-===//
+//===--------------------- Range.cpp -----------------------------*- C++
+//-*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -11,93 +12,63 @@
using namespace lldb_utility;
-Range::Range (const Range& rng) :
-m_low(rng.m_low),
-m_high(rng.m_high)
-{
- InitRange();
+Range::Range(const Range &rng) : m_low(rng.m_low), m_high(rng.m_high) {
+ InitRange();
}
-Range::Range (Range::ValueType low,
- Range::ValueType high) :
-m_low(low),
-m_high(high)
-{
- InitRange();
+Range::Range(Range::ValueType low, Range::ValueType high)
+ : m_low(low), m_high(high) {
+ InitRange();
}
-void
-Range::InitRange ()
-{
- if (m_low == OPEN_END)
- {
- if (m_high == OPEN_END)
- m_low = 0;
- else
- {
- // make an empty range
- m_low = 1;
- m_high = 0;
- }
+void Range::InitRange() {
+ if (m_low == OPEN_END) {
+ if (m_high == OPEN_END)
+ m_low = 0;
+ else {
+ // make an empty range
+ m_low = 1;
+ m_high = 0;
}
+ }
}
-Range&
-Range::operator = (const Range& rhs)
-{
- if (&rhs != this)
- {
- this->m_low = rhs.m_low;
- this->m_high = rhs.m_high;
- }
- return *this;
+Range &Range::operator=(const Range &rhs) {
+ if (&rhs != this) {
+ this->m_low = rhs.m_low;
+ this->m_high = rhs.m_high;
+ }
+ return *this;
}
-void
-Range::Flip ()
-{
- std::swap(m_high, m_low);
-}
+void Range::Flip() { std::swap(m_high, m_low); }
-void
-Range::Intersection (const Range& other)
-{
- m_low = std::max(m_low,other.m_low);
- m_high = std::min(m_high,other.m_high);
+void Range::Intersection(const Range &other) {
+ m_low = std::max(m_low, other.m_low);
+ m_high = std::min(m_high, other.m_high);
}
-void
-Range::Union (const Range& other)
-{
- m_low = std::min(m_low,other.m_low);
- m_high = std::max(m_high,other.m_high);
+void Range::Union(const Range &other) {
+ m_low = std::min(m_low, other.m_low);
+ m_high = std::max(m_high, other.m_high);
}
-void
-Range::Iterate (RangeCallback callback)
-{
- ValueType counter = m_low;
- while (counter <= m_high)
- {
- bool should_continue = callback(counter);
- if (!should_continue)
- return;
- counter++;
- }
+void Range::Iterate(RangeCallback callback) {
+ ValueType counter = m_low;
+ while (counter <= m_high) {
+ bool should_continue = callback(counter);
+ if (!should_continue)
+ return;
+ counter++;
+ }
}
-bool
-Range::IsEmpty ()
-{
- return (m_low > m_high);
-}
+bool Range::IsEmpty() { return (m_low > m_high); }
-Range::ValueType
-Range::GetSize ()
-{
- if (m_high == OPEN_END)
- return OPEN_END;
- if (m_high >= m_low)
- return m_high - m_low + 1;
- return 0;
+Range::ValueType Range::GetSize() {
+ if (m_high == OPEN_END)
+ return OPEN_END;
+ if (m_high >= m_low)
+ return m_high - m_low + 1;
+ return 0;
}