Skip to content

Commit a132f5e

Browse files
[BOLT] Fix a warning in release builds
This patch fixes: bolt/lib/Core/BinarySection.cpp:120:24: error: unused variable 'Relocation' [-Werror,-Wunused-variable]
1 parent cb9ac70 commit a132f5e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bolt/lib/Core/BinarySection.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ void BinarySection::emitAsData(MCStreamer &Streamer,
117117
if (std::any_of(ROI, ROE, HasUndefSym))
118118
continue;
119119

120+
#ifndef NDEBUG
120121
for (const auto &Relocation : make_range(ROI, ROE)) {
121122
LLVM_DEBUG(
122123
dbgs() << "BOLT-DEBUG: emitting relocation for symbol "
@@ -126,6 +127,7 @@ void BinarySection::emitAsData(MCStreamer &Streamer,
126127
<< " with size "
127128
<< Relocation::getSizeForType(Relocation.Type) << '\n');
128129
}
130+
#endif
129131

130132
size_t RelocationSize = Relocation::emit(ROI, ROE, &Streamer);
131133
SectionOffset += RelocationSize;

0 commit comments

Comments
 (0)