Fixup Asserts+!AbiBreakingChecks fallout from db33f85c7124
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 7 Jan 2021 22:17:24 +0000 (14:17 -0800)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 7 Jan 2021 22:18:19 +0000 (14:18 -0800)
llvm/include/llvm/IR/ValueHandle.h
llvm/unittests/IR/ValueHandleTest.cpp
llvm/unittests/Support/DataExtractorTest.cpp

index 1324053..a88b28a 100644 (file)
@@ -486,7 +486,9 @@ class PoisoningVH
 #endif
 
   ValueTy *getValPtr() const {
+#if LLVM_ENABLE_ABI_BREAKING_CHECKS
     assert(!Poisoned && "Accessed a poisoned value handle!");
+#endif
     return static_cast<ValueTy *>(getRawValPtr());
   }
   void setValPtr(ValueTy *P) { setRawValPtr(GetAsValue(P)); }
index 1aed8e1..8eb6b5f 100644 (file)
@@ -186,7 +186,7 @@ TEST_F(ValueHandle, AssertingVH_ReducesToPointer) {
   EXPECT_EQ(sizeof(CastInst *), sizeof(AssertingVH<CastInst>));
 }
 
-#else  // !NDEBUG
+#elif LLVM_ENABLE_ABI_BREAKING_CHECKS // && !NDEBUG
 
 #ifdef GTEST_HAS_DEATH_TEST
 
@@ -530,6 +530,7 @@ TEST_F(ValueHandle, TrackingVH_Tracks) {
 }
 
 #ifdef GTEST_HAS_DEATH_TEST
+#if LLVM_ENABLE_ABI_BREAKING_CHECKS
 
 TEST_F(ValueHandle, PoisoningVH_Asserts) {
   PoisoningVH<Value> VH(BitcastV.get());
@@ -549,6 +550,8 @@ TEST_F(ValueHandle, PoisoningVH_Asserts) {
   // Don't clear anything out here as destroying the handles should be fine.
 }
 
+#endif // LLVM_ENABLE_ABI_BREAKING_CHECKS
+
 TEST_F(ValueHandle, TrackingVH_Asserts) {
   {
     TrackingVH<Value> VH(BitcastV.get());
index 278e588..41c4064 100644 (file)
@@ -214,7 +214,8 @@ TEST(DataExtractorTest, Cursor_chaining) {
   EXPECT_THAT_ERROR(C.takeError(), Succeeded());
 }
 
-#if defined(GTEST_HAS_DEATH_TEST) && defined(_DEBUG)
+#if defined(GTEST_HAS_DEATH_TEST) && defined(_DEBUG) &&                        \
+    LLVM_ENABLE_ABI_BREAKING_CHECKS
 TEST(DataExtractorDeathTest, Cursor) {
   DataExtractor DE(StringRef("AB"), false, 8);