From e797f6f6ee3e0df31ecdd07932fcbcae17071771 Mon Sep 17 00:00:00 2001 From: Tomas Matheson Date: Fri, 18 Jun 2021 10:57:59 +0100 Subject: [PATCH] Allow building for release with EXPENSIVE_CHECKS D97225 moved LazyCallGraph verify() calls behind EXPENSIVE_CHECKS, but verity() is defined for debug builds only so this had the unintended effect of breaking release builds with EXPENSIVE_CHECKS. Fix by enabling verify() for both debug and EXPENSIVE_CHECKS. Differential Revision: https://reviews.llvm.org/D104514 --- include/llvm/Analysis/LazyCallGraph.h | 4 ++-- lib/Analysis/LazyCallGraph.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/llvm/Analysis/LazyCallGraph.h b/include/llvm/Analysis/LazyCallGraph.h index b97bf7c489e..ca276d2f3cf 100644 --- a/include/llvm/Analysis/LazyCallGraph.h +++ b/include/llvm/Analysis/LazyCallGraph.h @@ -463,7 +463,7 @@ public: /// Dump a short description of this SCC to stderr. void dump() const; -#ifndef NDEBUG +#if !defined(NDEBUG) || defined(EXPENSIVE_CHECKS) /// Verify invariants about the SCC. /// /// This will attempt to validate all of the basic invariants within an @@ -584,7 +584,7 @@ public: /// Dump a short description of this RefSCC to stderr. void dump() const; -#ifndef NDEBUG +#if !defined(NDEBUG) || defined(EXPENSIVE_CHECKS) /// Verify invariants about the RefSCC and all its SCCs. /// /// This will attempt to validate all of the invariants *within* the diff --git a/lib/Analysis/LazyCallGraph.cpp b/lib/Analysis/LazyCallGraph.cpp index 16ea59ec32c..8f87552fca1 100644 --- a/lib/Analysis/LazyCallGraph.cpp +++ b/lib/Analysis/LazyCallGraph.cpp @@ -241,7 +241,7 @@ LLVM_DUMP_METHOD void LazyCallGraph::SCC::dump() const { } #endif -#ifndef NDEBUG +#if !defined(NDEBUG) || defined(EXPENSIVE_CHECKS) void LazyCallGraph::SCC::verify() { assert(OuterRefSCC && "Can't have a null RefSCC!"); assert(!Nodes.empty() && "Can't have an empty SCC!"); @@ -333,7 +333,7 @@ LLVM_DUMP_METHOD void LazyCallGraph::RefSCC::dump() const { } #endif -#ifndef NDEBUG +#if !defined(NDEBUG) || defined(EXPENSIVE_CHECKS) void LazyCallGraph::RefSCC::verify() { assert(G && "Can't have a null graph!"); assert(!SCCs.empty() && "Can't have an empty SCC!");