From 3e0199f7ebab06654168e72add49b7f8eed75b27 Mon Sep 17 00:00:00 2001 From: Don Hinton Date: Thu, 12 Oct 2017 16:16:06 +0000 Subject: [dump] Remove NDEBUG from test to enable dump methods [NFC] Summary: Add LLVM_FORCE_ENABLE_DUMP cmake option, and use it along with LLVM_ENABLE_ASSERTIONS to set LLVM_ENABLE_DUMP. Remove NDEBUG and only use LLVM_ENABLE_DUMP to enable dump methods. Move definition of LLVM_ENABLE_DUMP from config.h to llvm-config.h so it'll be picked up by public headers. Differential Revision: https://reviews.llvm.org/D38406 llvm-svn: 315590 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp index 362ecab7320..0094ba4cc69 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp @@ -401,7 +401,7 @@ static Printable PrintNodeId(const SDNode &Node) { }); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void SDNode::dump() const { dump(nullptr); } LLVM_DUMP_METHOD void SDNode::dump(const SelectionDAG *G) const { @@ -604,7 +604,7 @@ static bool shouldPrintInline(const SDNode &Node) { return Node.getNumOperands() == 0; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP static void DumpNodes(const SDNode *N, unsigned indent, const SelectionDAG *G) { for (const SDValue &Op : N->op_values()) { if (shouldPrintInline(*Op.getNode())) @@ -658,7 +658,7 @@ static bool printOperand(raw_ostream &OS, const SelectionDAG *G, } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP using VisitedSDNodeSet = SmallPtrSet; static void DumpNodesr(raw_ostream &OS, const SDNode *N, unsigned indent, @@ -731,7 +731,7 @@ void SDNode::printrFull(raw_ostream &OS, const SelectionDAG *G) const { printrWithDepth(OS, G, 10); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void SDNode::dumprWithDepth(const SelectionDAG *G, unsigned depth) const { printrWithDepth(dbgs(), G, depth); -- cgit v1.2.3