@@ -47,13 +47,6 @@ struct MipsRelocationEntry {
47
47
}
48
48
};
49
49
50
- #ifndef NDEBUG
51
- raw_ostream &operator <<(raw_ostream &OS, const MipsRelocationEntry &RHS) {
52
- RHS.print (OS);
53
- return OS;
54
- }
55
- #endif
56
-
57
50
class MipsELFObjectWriter : public MCELFObjectTargetWriter {
58
51
public:
59
52
MipsELFObjectWriter (uint8_t OSABI, bool HasRelocationAddend, bool Is64);
@@ -115,17 +108,11 @@ static InputIt find_best(InputIt First, InputIt Last, UnaryPredicate Predicate,
115
108
for (InputIt I = First; I != Last; ++I) {
116
109
unsigned Matched = Predicate (*I);
117
110
if (Matched != FindBest_NoMatch) {
118
- LLVM_DEBUG (dbgs () << std::distance (First, I) << " is a match (" ;
119
- I->print (dbgs ()); dbgs () << " )\n " );
120
- if (Best == Last || BetterThan (*I, *Best)) {
121
- LLVM_DEBUG (dbgs () << " .. and it beats the last one\n " );
111
+ if (Best == Last || BetterThan (*I, *Best))
122
112
Best = I;
123
- }
124
113
}
125
- if (Matched == FindBest_PerfectMatch) {
126
- LLVM_DEBUG (dbgs () << " .. and it is unbeatable\n " );
114
+ if (Matched == FindBest_PerfectMatch)
127
115
break ;
128
- }
129
116
}
130
117
131
118
return Best;
@@ -201,15 +188,6 @@ static bool compareMatchingRelocs(const MipsRelocationEntry &Candidate,
201
188
return PreviousBest.Matched && !Candidate.Matched ;
202
189
}
203
190
204
- #ifndef NDEBUG
205
- // / Print all the relocations.
206
- template <class Container >
207
- static void dumpRelocs (const char *Prefix, const Container &Relocs) {
208
- for (const auto &R : Relocs)
209
- dbgs () << Prefix << R << " \n " ;
210
- }
211
- #endif
212
-
213
191
MipsELFObjectWriter::MipsELFObjectWriter (uint8_t OSABI,
214
192
bool HasRelocationAddend, bool Is64)
215
193
: MCELFObjectTargetWriter(Is64, OSABI, ELF::EM_MIPS, HasRelocationAddend) {}
@@ -448,8 +426,6 @@ void MipsELFObjectWriter::sortRelocs(const MCAssembler &Asm,
448
426
std::list<MipsRelocationEntry> Sorted;
449
427
std::list<ELFRelocationEntry> Remainder;
450
428
451
- LLVM_DEBUG (dumpRelocs (" R: " , Relocs));
452
-
453
429
// Separate the movable relocations (AHL relocations using the high bits) from
454
430
// the immobile relocations (everything else). This does not preserve high/low
455
431
// matches that already existed in the input.
@@ -459,8 +435,6 @@ void MipsELFObjectWriter::sortRelocs(const MCAssembler &Asm,
459
435
});
460
436
461
437
for (auto &R : Remainder) {
462
- LLVM_DEBUG (dbgs () << " Matching: " << R << " \n " );
463
-
464
438
unsigned MatchingType = getMatchingLoType (R);
465
439
assert (MatchingType != ELF::R_MIPS_NONE &&
466
440
" Wrong list for reloc that doesn't need a match" );
@@ -494,8 +468,6 @@ void MipsELFObjectWriter::sortRelocs(const MCAssembler &Asm,
494
468
Sorted.insert (InsertionPoint, R)->Matched = true ;
495
469
}
496
470
497
- LLVM_DEBUG (dumpRelocs (" S: " , Sorted));
498
-
499
471
assert (Relocs.size () == Sorted.size () && " Some relocs were not consumed" );
500
472
501
473
// Overwrite the original vector with the sorted elements.
0 commit comments