mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-20 12:05:48 -04:00

Summary: A *.cpp file header in LLDB (and in LLDB) should like this: ``` //===-- TestUtilities.cpp -------------------------------------------------===// ``` However in LLDB most of our source files have arbitrary changes to this format and these changes are spreading through LLDB as folks usually just use the existing source files as templates for their new files (most notably the unnecessary editor language indicator `-*- C++ -*-` is spreading and in every review someone is pointing out that this is wrong, resulting in people pointing out that this is done in the same way in other files). This patch removes most of these inconsistencies including the editor language indicators, all the different missing/additional '-' characters, files that center the file name, missing trailing `===//` (mostly caused by clang-format breaking the line). Reviewers: aprantl, espindola, jfb, shafik, JDevlieghere Reviewed By: JDevlieghere Subscribers: dexonsmith, wuzish, emaste, sdardis, nemanjai, kbarton, MaskRay, atanasyan, arphaman, jfb, abidh, jsji, JDevlieghere, usaxena95, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D73258
72 lines
2.1 KiB
C++
72 lines
2.1 KiB
C++
//===-- VMRange.cpp -------------------------------------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "lldb/Utility/VMRange.h"
|
|
|
|
#include "lldb/Utility/Stream.h"
|
|
#include "lldb/lldb-types.h"
|
|
|
|
#include <algorithm>
|
|
#include <iterator>
|
|
#include <vector>
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
using namespace lldb;
|
|
using namespace lldb_private;
|
|
|
|
bool VMRange::ContainsValue(const VMRange::collection &coll,
|
|
lldb::addr_t value) {
|
|
return llvm::find_if(coll, [&](const VMRange &r) {
|
|
return r.Contains(value);
|
|
}) != coll.end();
|
|
}
|
|
|
|
bool VMRange::ContainsRange(const VMRange::collection &coll,
|
|
const VMRange &range) {
|
|
return llvm::find_if(coll, [&](const VMRange &r) {
|
|
return r.Contains(range);
|
|
}) != coll.end();
|
|
}
|
|
|
|
void VMRange::Dump(llvm::raw_ostream &s, lldb::addr_t offset,
|
|
uint32_t addr_width) const {
|
|
DumpAddressRange(s, offset + GetBaseAddress(), offset + GetEndAddress(),
|
|
addr_width);
|
|
}
|
|
|
|
bool lldb_private::operator==(const VMRange &lhs, const VMRange &rhs) {
|
|
return lhs.GetBaseAddress() == rhs.GetBaseAddress() &&
|
|
lhs.GetEndAddress() == rhs.GetEndAddress();
|
|
}
|
|
|
|
bool lldb_private::operator!=(const VMRange &lhs, const VMRange &rhs) {
|
|
return !(lhs == rhs);
|
|
}
|
|
|
|
bool lldb_private::operator<(const VMRange &lhs, const VMRange &rhs) {
|
|
if (lhs.GetBaseAddress() < rhs.GetBaseAddress())
|
|
return true;
|
|
else if (lhs.GetBaseAddress() > rhs.GetBaseAddress())
|
|
return false;
|
|
return lhs.GetEndAddress() < rhs.GetEndAddress();
|
|
}
|
|
|
|
bool lldb_private::operator<=(const VMRange &lhs, const VMRange &rhs) {
|
|
return !(lhs > rhs);
|
|
}
|
|
|
|
bool lldb_private::operator>(const VMRange &lhs, const VMRange &rhs) {
|
|
return rhs < lhs;
|
|
}
|
|
|
|
bool lldb_private::operator>=(const VMRange &lhs, const VMRange &rhs) {
|
|
return !(lhs < rhs);
|
|
}
|