SmallPtrSet<const BlockT *, 8> DenseBlockSet;
-#if !defined(NDEBUG) || !LLVM_ENABLE_ABI_BREAKING_CHECKS
+#if LLVM_ENABLE_ABI_BREAKING_CHECKS
/// Indicator that this loop is no longer a valid loop.
bool IsInvalid = false;
#endif
return Blocks.size();
}
-#ifndef NDEBUG
/// Return true if this loop is no longer valid. The only valid use of this
/// helper is "assert(L.isInvalid())" or equivalent, since IsInvalid is set to
- /// false by the destructor. In other words, if this accessor returns false,
+ /// true by the destructor. In other words, if this accessor returns true,
/// the caller has already triggered UB by calling this accessor; and so it
- /// can only be called in a context where a return value of false indicates a
+ /// can only be called in a context where a return value of true indicates a
/// programmer error.
- bool isInvalid() const { return IsInvalid; }
+ bool isInvalid() const {
+#if LLVM_ENABLE_ABI_BREAKING_CHECKS
+ return IsInvalid;
+#else
+ return false;
#endif
+ }
/// True if terminator in the block can branch to another block that is
/// outside of the current loop.
for (auto *SubLoop : SubLoops)
SubLoop->~LoopT();
+#if LLVM_ENABLE_ABI_BREAKING_CHECKS
IsInvalid = true;
+#endif
SubLoops.clear();
Blocks.clear();
DenseBlockSet.clear();