diff --git a/clang/lib/AST/Interp/Disasm.cpp b/clang/lib/AST/Interp/Disasm.cpp --- a/clang/lib/AST/Interp/Disasm.cpp +++ b/clang/lib/AST/Interp/Disasm.cpp @@ -34,6 +34,7 @@ LLVM_DUMP_METHOD void Function::dump() const { dump(llvm::errs()); } LLVM_DUMP_METHOD void Function::dump(llvm::raw_ostream &OS) const { +#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) if (F) { if (const auto *MD = dyn_cast(F)) OS << MD->getParent()->getDeclName() << "::"; @@ -64,6 +65,7 @@ #undef GET_DISASM } } +#endif } LLVM_DUMP_METHOD void Program::dump() const { dump(llvm::errs()); } diff --git a/clang/utils/TableGen/ClangOpcodesEmitter.cpp b/clang/utils/TableGen/ClangOpcodesEmitter.cpp --- a/clang/utils/TableGen/ClangOpcodesEmitter.cpp +++ b/clang/utils/TableGen/ClangOpcodesEmitter.cpp @@ -161,6 +161,7 @@ } void ClangOpcodesEmitter::EmitDisasm(raw_ostream &OS, StringRef N, Record *R) { +#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) OS << "#ifdef GET_DISASM\n"; Enumerate(R, N, [R, &OS](ArrayRef, const Twine &ID) { OS << "case OP_" << ID << ":\n"; @@ -176,6 +177,7 @@ OS << " continue;\n"; }); OS << "#endif\n"; +#endif } void ClangOpcodesEmitter::EmitEmitter(raw_ostream &OS, StringRef N, Record *R) {