From 481e2ddef452a261a202ec60b02ab8b31f022c7f Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Thu, 31 Mar 2022 23:27:10 -0700 Subject: [PATCH] [CSKY] AsmBackend: Wrap Inst.dump() in LLVM_DEBUG -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=CSKY -DLLVM_ENABLE_ASSERTIONS=OFF builds will fail to link due to undefined `llvm::MCInst::dump() const` ``` ld.lld: error: undefined symbol: llvm::MCInst::dump() const >>> referenced by CSKYAsmBackend.cpp >>> /home/kees/src/built-compilers/llvm/stage2-prof-gen/lto.cache/llvmcache-0656FC38C728A7FE0F767D10CD84C7F820114C46:(llvm::CSKYAsmBackend::relaxInstruction(llvm::MCInst&, llvm::MCSubtargetInfo const&) const) ``` Wrap it in LLVM_DEBUG(). Fixes https://github.com/llvm/llvm-project/issues/54684 Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D122854 --- llvm/lib/Target/CSKY/MCTargetDesc/CSKYAsmBackend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYAsmBackend.cpp b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYAsmBackend.cpp index 41da382..b5dfdfa 100644 --- a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYAsmBackend.cpp +++ b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYAsmBackend.cpp @@ -295,7 +295,7 @@ void CSKYAsmBackend::relaxInstruction(MCInst &Inst, switch (Inst.getOpcode()) { default: - Inst.dump(); + LLVM_DEBUG(Inst.dump()); llvm_unreachable("Opcode not expected!"); case CSKY::LRW16: Res.setOpcode(CSKY::LRW32); -- 2.7.4