Skip to content

Commit dcddf16

Browse files
Fix formatting to match LLVM style
1 parent fae745a commit dcddf16

File tree

4 files changed

+20
-17
lines changed

4 files changed

+20
-17
lines changed

lldb/include/lldb/Expression/DWARFExpressionList.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class DWARFExpressionList {
5959
}
6060

6161
lldb::addr_t GetFuncFileAddress() { return m_func_file_addr; }
62-
62+
6363
/// Represents an entry in the DWARFExpressionList with all needed metadata.
6464
struct DWARFExpressionEntry {
6565
/// Represents a DWARF location range in the DWARF unit’s file‐address space
@@ -69,7 +69,8 @@ class DWARFExpressionList {
6969

7070
/// Returns a DWARFExpressionEntry whose file_range contains the given
7171
/// load‐address. `func_load_addr` is the load‐address of the function
72-
/// start; `load_addr` is the full runtime PC. On success, `expr` is non-null.
72+
/// start; `load_addr` is the full runtime PC. On success, `expr` is
73+
/// non-null.
7374
std::optional<DWARFExpressionEntry>
7475
GetExpressionEntryAtAddress(lldb::addr_t func_load_addr,
7576
lldb::addr_t load_addr) const;

lldb/source/Expression/DWARFExpression.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ void DWARFExpression::UpdateValue(uint64_t const_value,
6767
}
6868

6969
void DWARFExpression::DumpLocation(Stream *s, lldb::DescriptionLevel level,
70-
ABI *abi, llvm::DIDumpOptions options) const {
70+
ABI *abi,
71+
llvm::DIDumpOptions options) const {
7172
auto *MCRegInfo = abi ? &abi->GetMCRegisterInfo() : nullptr;
7273
auto GetRegName = [&MCRegInfo](uint64_t DwarfRegNum,
7374
bool IsEH) -> llvm::StringRef {

lldb/source/Expression/DWARFExpressionList.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "lldb/Core/AddressRange.h"
109
#include "lldb/Expression/DWARFExpressionList.h"
1110
#include "lldb/Core/AddressRange.h"
1211
#include "lldb/Symbol/Function.h"
@@ -57,28 +56,29 @@ bool DWARFExpressionList::ContainsAddress(lldb::addr_t func_load_addr,
5756

5857
std::optional<DWARFExpressionList::DWARFExpressionEntry>
5958
DWARFExpressionList::GetExpressionEntryAtAddress(lldb::addr_t func_load_addr,
60-
lldb::addr_t load_addr) const {
59+
lldb::addr_t load_addr) const {
6160
if (const DWARFExpression *always = GetAlwaysValidExpr()) {
6261
return DWARFExpressionEntry{std::nullopt, always};
6362
}
6463

6564
if (func_load_addr == LLDB_INVALID_ADDRESS)
6665
func_load_addr = m_func_file_addr;
6766

68-
// Guard against underflow when translating a load address back into file space.
67+
// Guard against underflow when translating a load address back into file
68+
// space.
6969
if (load_addr < func_load_addr)
70-
return std::nullopt;
70+
return std::nullopt;
7171

7272
// Guard against overflow.
7373
lldb::addr_t delta = load_addr - func_load_addr;
7474
if (delta > std::numeric_limits<lldb::addr_t>::max() - m_func_file_addr)
7575
return std::nullopt;
7676

7777
lldb::addr_t file_pc = (load_addr - func_load_addr) + m_func_file_addr;
78-
78+
7979
if (const auto *entry = m_exprs.FindEntryThatContains(file_pc)) {
8080
AddressRange range_in_file(entry->GetRangeBase(),
81-
entry->GetRangeEnd() - entry->GetRangeBase());
81+
entry->GetRangeEnd() - entry->GetRangeBase());
8282
return DWARFExpressionEntry{range_in_file, &entry->data};
8383
}
8484

llvm/lib/DebugInfo/DWARF/DWARFExpressionPrinter.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,23 +68,24 @@ static bool printOp(const DWARFExpression::Operation *Op, raw_ostream &OS,
6868

6969
if (!DumpOpts.PrintRegisterOnly) {
7070
for (unsigned Operand = 0; Operand < Op->getDescription().Op.size();
71-
++Operand) {
71+
++Operand) {
7272
unsigned Size = Op->getDescription().Op[Operand];
7373
unsigned Signed = Size & DWARFExpression::Operation::SignBit;
7474

7575
if (Size == DWARFExpression::Operation::SizeSubOpLEB) {
76-
StringRef SubName =
77-
SubOperationEncodingString(Op->getCode(), Op->getRawOperand(Operand));
76+
StringRef SubName = SubOperationEncodingString(
77+
Op->getCode(), Op->getRawOperand(Operand));
7878
assert(!SubName.empty() && "DW_OP SubOp has no name!");
7979
OS << " " << SubName;
8080
} else if (Size == DWARFExpression::Operation::BaseTypeRef && U) {
8181
// For DW_OP_convert the operand may be 0 to indicate that conversion to
82-
// the generic type should be done. The same holds for DW_OP_reinterpret,
83-
// which is currently not supported.
82+
// the generic type should be done. The same holds for
83+
// DW_OP_reinterpret, which is currently not supported.
8484
if (Op->getCode() == DW_OP_convert && Op->getRawOperand(Operand) == 0)
8585
OS << " 0x0";
8686
else
87-
prettyPrintBaseTypeRef(U, OS, DumpOpts, Op->getRawOperands(), Operand);
87+
prettyPrintBaseTypeRef(U, OS, DumpOpts, Op->getRawOperands(),
88+
Operand);
8889
} else if (Size == DWARFExpression::Operation::WasmLocationArg) {
8990
assert(Operand == 1);
9091
switch (Op->getRawOperand(0)) {
@@ -102,12 +103,12 @@ static bool printOp(const DWARFExpression::Operation *Op, raw_ostream &OS,
102103
uint64_t Offset = Op->getRawOperand(Operand);
103104
for (unsigned i = 0; i < Op->getRawOperand(Operand - 1); ++i)
104105
OS << format(" 0x%02x",
105-
static_cast<uint8_t>(Expr->getData()[Offset++]));
106+
static_cast<uint8_t>(Expr->getData()[Offset++]));
106107
} else {
107108
if (Signed)
108109
OS << format(" %+" PRId64, (int64_t)Op->getRawOperand(Operand));
109110
else if (Op->getCode() != DW_OP_entry_value &&
110-
Op->getCode() != DW_OP_GNU_entry_value)
111+
Op->getCode() != DW_OP_GNU_entry_value)
111112
OS << format(" 0x%" PRIx64, Op->getRawOperand(Operand));
112113
}
113114
}

0 commit comments

Comments
 (0)