Skip to content

Commit cb709ed

Browse files
committed
Run clang-format
1 parent 13771da commit cb709ed

File tree

3 files changed

+19
-24
lines changed

3 files changed

+19
-24
lines changed

llvm/tools/llvm-objdump/SourcePrinter.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -508,12 +508,8 @@ SourcePrinter::SourcePrinter(const object::ObjectFile *Obj,
508508

509509
// TODO Light/dark shades? 256-color terminals?
510510
const raw_ostream::Colors LineColors[] = {
511-
raw_ostream::RED,
512-
raw_ostream::GREEN,
513-
raw_ostream::YELLOW,
514-
raw_ostream::BLUE,
515-
raw_ostream::MAGENTA,
516-
raw_ostream::CYAN,
511+
raw_ostream::RED, raw_ostream::GREEN, raw_ostream::YELLOW,
512+
raw_ostream::BLUE, raw_ostream::MAGENTA, raw_ostream::CYAN,
517513
};
518514

519515
raw_ostream::Colors ControlFlowPrinter::PickColor() {
@@ -528,7 +524,8 @@ raw_ostream::Colors ControlFlowPrinter::PickColor() {
528524
void ControlFlowPrinter::addEdge(uint64_t From, uint64_t To) {
529525
auto It = Targets.find(To);
530526
if (It == Targets.end())
531-
It = Targets.insert(std::make_pair(To, ControlFlowTarget(To, PickColor()))).first;
527+
It = Targets.insert(std::make_pair(To, ControlFlowTarget(To, PickColor())))
528+
.first;
532529
It->second.addSource(From);
533530
}
534531

@@ -559,7 +556,6 @@ void ControlFlowPrinter::finalise() {
559556
break;
560557
T->Column = Column;
561558
MaxColumn = std::max(MaxColumn, Column);
562-
563559
}
564560

565561
setControlFlowColumnWidth(MaxColumn * 2 + 4);

llvm/tools/llvm-objdump/SourcePrinter.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ struct VisualizeJumpsMode {
180180
VisualizeJumpsMode(Chars_t Chars, Colors_t Colors)
181181
: Chars(Chars), Colors(Colors) {}
182182

183-
static VisualizeJumpsMode GetDefault() { return VisualizeJumpsMode(Unicode, Auto); }
183+
static VisualizeJumpsMode GetDefault() {
184+
return VisualizeJumpsMode(Unicode, Auto);
185+
}
184186

185187
bool enabled() const { return Chars != Off; }
186188
bool color_enabled() const { return enabled() && Colors != BlackAndWhite; }
@@ -192,7 +194,6 @@ struct VisualizeJumpsMode {
192194
}
193195
};
194196

195-
196197
class ControlFlowPrinter {
197198
struct ControlFlowTarget {
198199
uint64_t Target;
@@ -201,7 +202,8 @@ class ControlFlowPrinter {
201202
raw_ostream::Colors Color;
202203

203204
ControlFlowTarget(uint64_t Target, raw_ostream::Colors Color)
204-
: Target(Target), Column(~0U), Color(Color), High(Target), Low(Target) {}
205+
: Target(Target), Column(~0U), Color(Color), High(Target), Low(Target) {
206+
}
205207
ControlFlowTarget(const ControlFlowTarget &) = delete;
206208
ControlFlowTarget(ControlFlowTarget &&) = default;
207209

llvm/tools/llvm-objdump/llvm-objdump.cpp

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ unsigned objdump::GetColumnIndent(MCSubtargetInfo const &STI,
509509

510510
// Encoding: depends on architecture
511511
if (ShowRawInsn)
512-
Indent += EncodingColumnWidth(STI.getTargetTriple());
512+
Indent += EncodingColumnWidth(STI.getTargetTriple());
513513

514514
// Special case for assembly string: the assembly printer uses tabs, so we
515515
// need to ensure we start the instruction on a tab stop (multiple of 8).
@@ -542,7 +542,7 @@ void objdump::IndentToColumn(MCSubtargetInfo const &STI,
542542
if (Col == DisassemblyColumn::Assembly) {
543543
TargetIndent -= 1;
544544
if (TargetIndent < CurrentIndent)
545-
TargetIndent = alignTo(CurrentIndent + 1, 8) - 1;
545+
TargetIndent = alignTo(CurrentIndent + 1, 8) - 1;
546546
}
547547

548548
if (TargetIndent > CurrentIndent)
@@ -1358,14 +1358,12 @@ collectBBAddrMapLabels(const std::unordered_map<uint64_t, BBAddrMap> &AddrToBBAd
13581358
}
13591359
}
13601360

1361-
static void
1362-
collectLocalBranchTargets(ArrayRef<uint8_t> Bytes, MCInstrAnalysis *MIA,
1363-
MCDisassembler *DisAsm, MCInstPrinter *IP,
1364-
const MCSubtargetInfo *STI, uint64_t SectionAddr,
1365-
uint64_t Start, uint64_t End,
1366-
std::unordered_map<uint64_t, std::string> &Labels,
1367-
ControlFlowPrinter &CFP,
1368-
std::vector<RelocationRef> &Relocs) {
1361+
static void collectLocalBranchTargets(
1362+
ArrayRef<uint8_t> Bytes, MCInstrAnalysis *MIA, MCDisassembler *DisAsm,
1363+
MCInstPrinter *IP, const MCSubtargetInfo *STI, uint64_t SectionAddr,
1364+
uint64_t Start, uint64_t End,
1365+
std::unordered_map<uint64_t, std::string> &Labels, ControlFlowPrinter &CFP,
1366+
std::vector<RelocationRef> &Relocs) {
13691367
if (MIA)
13701368
MIA->resetState();
13711369

@@ -1951,7 +1949,6 @@ disassembleObject(ObjectFile &Obj, const ObjectFile &DbgObj,
19511949
Start -= SectionAddr;
19521950
End -= SectionAddr;
19531951

1954-
19551952
formatted_raw_ostream FOS(outs());
19561953

19571954
if (!PrintedSection) {
@@ -3393,7 +3390,8 @@ static void parseObjdumpOptions(const llvm::opt::InputArgList &InputArgs) {
33933390
if (DisassemblyColor == ColorOutput::Invalid)
33943391
invalidArgValue(A);
33953392
}
3396-
if (const opt::Arg *A = InputArgs.getLastArg(OBJDUMP_visualize_jumps, OBJDUMP_visualize_jumps_EQ)) {
3393+
if (const opt::Arg *A = InputArgs.getLastArg(OBJDUMP_visualize_jumps,
3394+
OBJDUMP_visualize_jumps_EQ)) {
33973395
if (A->getOption().matches(OBJDUMP_visualize_jumps)) {
33983396
// --visualize-jumps without an argument default to unicode, auto-color.
33993397
VisualizeJumps = VisualizeJumpsMode::GetDefault();
@@ -3422,7 +3420,6 @@ static void parseObjdumpOptions(const llvm::opt::InputArgList &InputArgs) {
34223420
}
34233421
}
34243422

3425-
34263423
VisualizeJumps = VisualizeJumpsMode(Chars, Color);
34273424
}
34283425

0 commit comments

Comments
 (0)