Skip to content

Commit

Permalink
Allow building for release with EXPENSIVE_CHECKS
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tmatheson-arm committed Jun 19, 2021
1 parent 18dbe68 commit 1bcfa84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions llvm/include/llvm/Analysis/LazyCallGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ class LazyCallGraph {
/// 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
Expand Down Expand Up @@ -584,7 +584,7 @@ class LazyCallGraph {
/// 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
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Analysis/LazyCallGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
Expand Down Expand Up @@ -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!");
Expand Down

0 comments on commit 1bcfa84

Please sign in to comment.