From 7a6878a72ec4168434103b7461065a500754861d Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Wed, 4 Mar 2020 22:36:24 -0800 Subject: [PATCH] X86AsmBackend.cpp: #ifndef NDEBUG some only-used-in-asserts variables to fix the -Werror non-asserts build --- llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp index e56c049..88487f5 100644 --- a/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp +++ b/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp @@ -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(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 -- 2.7.4