[llvm-branch-commits] [llvm] 3503c85 - Fixup Asserts+!AbiBreakingChecks fallout from db33f85c7124

David Blaikie via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jan 7 14:22:41 PST 2021


Author: David Blaikie
Date: 2021-01-07T14:18:19-08:00
New Revision: 3503c856819efc01ce210fa56e597ddfb7a4c1a1

URL: https://github.com/llvm/llvm-project/commit/3503c856819efc01ce210fa56e597ddfb7a4c1a1
DIFF: https://github.com/llvm/llvm-project/commit/3503c856819efc01ce210fa56e597ddfb7a4c1a1.diff

LOG: Fixup Asserts+!AbiBreakingChecks fallout from db33f85c7124

Added: 
    

Modified: 
    llvm/include/llvm/IR/ValueHandle.h
    llvm/unittests/IR/ValueHandleTest.cpp
    llvm/unittests/Support/DataExtractorTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/ValueHandle.h b/llvm/include/llvm/IR/ValueHandle.h
index 1324053800c7..a88b28ac7e62 100644
--- a/llvm/include/llvm/IR/ValueHandle.h
+++ b/llvm/include/llvm/IR/ValueHandle.h
@@ -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)); }

diff  --git a/llvm/unittests/IR/ValueHandleTest.cpp b/llvm/unittests/IR/ValueHandleTest.cpp
index 1aed8e1a1ee7..8eb6b5f89a40 100644
--- a/llvm/unittests/IR/ValueHandleTest.cpp
+++ b/llvm/unittests/IR/ValueHandleTest.cpp
@@ -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());

diff  --git a/llvm/unittests/Support/DataExtractorTest.cpp b/llvm/unittests/Support/DataExtractorTest.cpp
index 278e5885916c..41c40648b85e 100644
--- a/llvm/unittests/Support/DataExtractorTest.cpp
+++ b/llvm/unittests/Support/DataExtractorTest.cpp
@@ -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);
 


        


More information about the llvm-branch-commits mailing list