1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00

X86AsmBackend.cpp: #ifndef NDEBUG some only-used-in-asserts variables to fix the -Werror non-asserts build

This commit is contained in:
David Blaikie 2020-03-04 22:36:24 -08:00
parent 87a444bd04
commit 557ca60d45

View File

@ -820,7 +820,9 @@ void X86AsmBackend::finishLayout(MCAssembler const &Asm,
continue;
}
#ifndef NDEBUG
const uint64_t OrigOffset = Layout.getFragmentOffset(&F);
#endif
const uint64_t OrigSize = Asm.computeFragmentSize(Layout, F);
if (OrigSize == 0 || Relaxable.empty()) {
Relaxable.clear();
@ -863,11 +865,13 @@ void X86AsmBackend::finishLayout(MCAssembler const &Asm,
if (F.getKind() == MCFragment::FT_BoundaryAlign)
cast<MCBoundaryAlignFragment>(F).setSize(RemainingSize);
#ifndef NDEBUG
const uint64_t FinalOffset = Layout.getFragmentOffset(&F);
const uint64_t FinalSize = Asm.computeFragmentSize(Layout, F);
assert(OrigOffset + OrigSize == FinalOffset + FinalSize &&
"can't move start of next fragment!");
assert(FinalSize == RemainingSize && "inconsistent size computation?");
#endif
// If we're looking at a boundary align, make sure we don't try to pad
// its target instructions for some following directive. Doing so would