[llvm] r314539 - Use LLVM_ENABLE_ABI_BREAKING_CHECKS correctly
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 29 10:17:54 PDT 2017
Author: sanjoy
Date: Fri Sep 29 10:17:54 2017
New Revision: 314539
URL: http://llvm.org/viewvc/llvm-project?rev=314539&view=rev
Log:
Use LLVM_ENABLE_ABI_BREAKING_CHECKS correctly
Modified:
llvm/trunk/include/llvm/Analysis/LoopInfo.h
Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=314539&r1=314538&r2=314539&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Fri Sep 29 10:17:54 2017
@@ -76,7 +76,7 @@ template <class BlockT, class LoopT> cla
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
@@ -165,15 +165,19 @@ public:
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.
@@ -392,7 +396,9 @@ protected:
for (auto *SubLoop : SubLoops)
SubLoop->~LoopT();
+#if LLVM_ENABLE_ABI_BREAKING_CHECKS
IsInvalid = true;
+#endif
SubLoops.clear();
Blocks.clear();
DenseBlockSet.clear();
More information about the llvm-commits
mailing list