1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00

Fixup Asserts+!AbiBreakingChecks fallout from db33f85c7124

This commit is contained in:
David Blaikie 2021-01-07 14:17:24 -08:00
parent c36c53588a
commit 6d236cf44b
3 changed files with 8 additions and 2 deletions

View File

@ -486,7 +486,9 @@ class PoisoningVH
#endif #endif
ValueTy *getValPtr() const { ValueTy *getValPtr() const {
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
assert(!Poisoned && "Accessed a poisoned value handle!"); assert(!Poisoned && "Accessed a poisoned value handle!");
#endif
return static_cast<ValueTy *>(getRawValPtr()); return static_cast<ValueTy *>(getRawValPtr());
} }
void setValPtr(ValueTy *P) { setRawValPtr(GetAsValue(P)); } void setValPtr(ValueTy *P) { setRawValPtr(GetAsValue(P)); }

View File

@ -186,7 +186,7 @@ TEST_F(ValueHandle, AssertingVH_ReducesToPointer) {
EXPECT_EQ(sizeof(CastInst *), sizeof(AssertingVH<CastInst>)); EXPECT_EQ(sizeof(CastInst *), sizeof(AssertingVH<CastInst>));
} }
#else // !NDEBUG #elif LLVM_ENABLE_ABI_BREAKING_CHECKS // && !NDEBUG
#ifdef GTEST_HAS_DEATH_TEST #ifdef GTEST_HAS_DEATH_TEST
@ -530,6 +530,7 @@ TEST_F(ValueHandle, TrackingVH_Tracks) {
} }
#ifdef GTEST_HAS_DEATH_TEST #ifdef GTEST_HAS_DEATH_TEST
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
TEST_F(ValueHandle, PoisoningVH_Asserts) { TEST_F(ValueHandle, PoisoningVH_Asserts) {
PoisoningVH<Value> VH(BitcastV.get()); 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. // Don't clear anything out here as destroying the handles should be fine.
} }
#endif // LLVM_ENABLE_ABI_BREAKING_CHECKS
TEST_F(ValueHandle, TrackingVH_Asserts) { TEST_F(ValueHandle, TrackingVH_Asserts) {
{ {
TrackingVH<Value> VH(BitcastV.get()); TrackingVH<Value> VH(BitcastV.get());

View File

@ -214,7 +214,8 @@ TEST(DataExtractorTest, Cursor_chaining) {
EXPECT_THAT_ERROR(C.takeError(), Succeeded()); 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) { TEST(DataExtractorDeathTest, Cursor) {
DataExtractor DE(StringRef("AB"), false, 8); DataExtractor DE(StringRef("AB"), false, 8);