summaryrefslogtreecommitdiff
path: root/unittests/IR
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/IR')
-rw-r--r--unittests/IR/ConstantRangeTest.cpp8
-rw-r--r--unittests/IR/DominatorTreeTest.cpp2
-rw-r--r--unittests/IR/IRBuilderTest.cpp10
-rw-r--r--unittests/IR/InstructionsTest.cpp16
-rw-r--r--unittests/IR/LegacyPassManagerTest.cpp14
-rw-r--r--unittests/IR/MDBuilderTest.cpp14
-rw-r--r--unittests/IR/MetadataTest.cpp2
-rw-r--r--unittests/IR/PassManagerTest.cpp2
-rw-r--r--unittests/IR/PatternMatch.cpp12
-rw-r--r--unittests/IR/TypeBuilderTest.cpp6
-rw-r--r--unittests/IR/UserTest.cpp2
-rw-r--r--unittests/IR/ValueHandleTest.cpp32
-rw-r--r--unittests/IR/ValueMapTest.cpp4
-rw-r--r--unittests/IR/ValueTest.cpp6
-rw-r--r--unittests/IR/WaymarkTest.cpp2
15 files changed, 66 insertions, 66 deletions
diff --git a/unittests/IR/ConstantRangeTest.cpp b/unittests/IR/ConstantRangeTest.cpp
index cdf7378c17..fa03302ad2 100644
--- a/unittests/IR/ConstantRangeTest.cpp
+++ b/unittests/IR/ConstantRangeTest.cpp
@@ -99,11 +99,11 @@ TEST_F(ConstantRangeTest, Equality) {
}
TEST_F(ConstantRangeTest, SingleElement) {
- EXPECT_EQ(Full.getSingleElement(), static_cast<APInt *>(NULL));
- EXPECT_EQ(Empty.getSingleElement(), static_cast<APInt *>(NULL));
+ EXPECT_EQ(Full.getSingleElement(), static_cast<APInt *>(nullptr));
+ EXPECT_EQ(Empty.getSingleElement(), static_cast<APInt *>(nullptr));
EXPECT_EQ(*One.getSingleElement(), APInt(16, 0xa));
- EXPECT_EQ(Some.getSingleElement(), static_cast<APInt *>(NULL));
- EXPECT_EQ(Wrap.getSingleElement(), static_cast<APInt *>(NULL));
+ EXPECT_EQ(Some.getSingleElement(), static_cast<APInt *>(nullptr));
+ EXPECT_EQ(Wrap.getSingleElement(), static_cast<APInt *>(nullptr));
EXPECT_FALSE(Full.isSingleElement());
EXPECT_FALSE(Empty.isSingleElement());
diff --git a/unittests/IR/DominatorTreeTest.cpp b/unittests/IR/DominatorTreeTest.cpp
index 98c2317f2c..ab43d1c91f 100644
--- a/unittests/IR/DominatorTreeTest.cpp
+++ b/unittests/IR/DominatorTreeTest.cpp
@@ -213,7 +213,7 @@ namespace llvm {
"}\n";
LLVMContext &C = getGlobalContext();
SMDiagnostic Err;
- return ParseAssemblyString(ModuleStrig, NULL, Err, C);
+ return ParseAssemblyString(ModuleStrig, nullptr, Err, C);
}
TEST(DominatorTree, Unreachable) {
diff --git a/unittests/IR/IRBuilderTest.cpp b/unittests/IR/IRBuilderTest.cpp
index 9796e44599..21085755fb 100644
--- a/unittests/IR/IRBuilderTest.cpp
+++ b/unittests/IR/IRBuilderTest.cpp
@@ -31,11 +31,11 @@ protected:
F = Function::Create(FTy, Function::ExternalLinkage, "", M.get());
BB = BasicBlock::Create(Ctx, "", F);
GV = new GlobalVariable(*M, Type::getFloatTy(Ctx), true,
- GlobalValue::ExternalLinkage, 0);
+ GlobalValue::ExternalLinkage, nullptr);
}
virtual void TearDown() {
- BB = 0;
+ BB = nullptr;
M.reset();
}
@@ -71,9 +71,9 @@ TEST_F(IRBuilderTest, Lifetime) {
IntrinsicInst *II_Start1 = dyn_cast<IntrinsicInst>(Start1);
IntrinsicInst *II_End1 = dyn_cast<IntrinsicInst>(End1);
- ASSERT_TRUE(II_Start1 != NULL);
+ ASSERT_TRUE(II_Start1 != nullptr);
EXPECT_EQ(II_Start1->getIntrinsicID(), Intrinsic::lifetime_start);
- ASSERT_TRUE(II_End1 != NULL);
+ ASSERT_TRUE(II_End1 != nullptr);
EXPECT_EQ(II_End1->getIntrinsicID(), Intrinsic::lifetime_end);
}
@@ -203,7 +203,7 @@ TEST_F(IRBuilderTest, WrapFlags) {
// Test instructions.
GlobalVariable *G = new GlobalVariable(*M, Builder.getInt32Ty(), true,
- GlobalValue::ExternalLinkage, 0);
+ GlobalValue::ExternalLinkage, nullptr);
Value *V = Builder.CreateLoad(G);
EXPECT_TRUE(
cast<BinaryOperator>(Builder.CreateNSWAdd(V, V))->hasNoSignedWrap());
diff --git a/unittests/IR/InstructionsTest.cpp b/unittests/IR/InstructionsTest.cpp
index 336f5a2dcd..7ec9b62207 100644
--- a/unittests/IR/InstructionsTest.cpp
+++ b/unittests/IR/InstructionsTest.cpp
@@ -415,7 +415,7 @@ TEST(InstructionsTest, isEliminableCastPair) {
EXPECT_EQ(CastInst::isEliminableCastPair(CastInst::PtrToInt,
CastInst::IntToPtr,
Int64PtrTy, Int64Ty, Int64PtrTy,
- Int32Ty, 0, Int32Ty),
+ Int32Ty, nullptr, Int32Ty),
CastInst::BitCast);
// Source and destination have unknown sizes, but the same address space and
@@ -423,7 +423,7 @@ TEST(InstructionsTest, isEliminableCastPair) {
EXPECT_EQ(CastInst::isEliminableCastPair(CastInst::PtrToInt,
CastInst::IntToPtr,
Int64PtrTy, Int64Ty, Int64PtrTy,
- 0, 0, 0),
+ nullptr, nullptr, nullptr),
CastInst::BitCast);
// Source and destination have unknown sizes, but the same address space and
@@ -431,21 +431,21 @@ TEST(InstructionsTest, isEliminableCastPair) {
EXPECT_EQ(CastInst::isEliminableCastPair(CastInst::PtrToInt,
CastInst::IntToPtr,
Int64PtrTy, Int32Ty, Int64PtrTy,
- 0, 0, 0),
+ nullptr, nullptr, nullptr),
0U);
// Middle pointer big enough -> bitcast.
EXPECT_EQ(CastInst::isEliminableCastPair(CastInst::IntToPtr,
CastInst::PtrToInt,
Int64Ty, Int64PtrTy, Int64Ty,
- 0, Int64Ty, 0),
+ nullptr, Int64Ty, nullptr),
CastInst::BitCast);
// Middle pointer too small -> fail.
EXPECT_EQ(CastInst::isEliminableCastPair(CastInst::IntToPtr,
CastInst::PtrToInt,
Int64Ty, Int64PtrTy, Int64Ty,
- 0, Int32Ty, 0),
+ nullptr, Int32Ty, nullptr),
0U);
// Test that we don't eliminate bitcasts between different address spaces,
@@ -464,21 +464,21 @@ TEST(InstructionsTest, isEliminableCastPair) {
EXPECT_EQ(CastInst::isEliminableCastPair(CastInst::IntToPtr,
CastInst::AddrSpaceCast,
Int16Ty, Int64PtrTyAS1, Int64PtrTyAS2,
- 0, Int16SizePtr, Int64SizePtr),
+ nullptr, Int16SizePtr, Int64SizePtr),
0U);
// Cannot simplify addrspacecast, ptrtoint
EXPECT_EQ(CastInst::isEliminableCastPair(CastInst::AddrSpaceCast,
CastInst::PtrToInt,
Int64PtrTyAS1, Int64PtrTyAS2, Int16Ty,
- Int64SizePtr, Int16SizePtr, 0),
+ Int64SizePtr, Int16SizePtr, nullptr),
0U);
// Pass since the bitcast address spaces are the same
EXPECT_EQ(CastInst::isEliminableCastPair(CastInst::IntToPtr,
CastInst::BitCast,
Int16Ty, Int64PtrTyAS1, Int64PtrTyAS1,
- 0, 0, 0),
+ nullptr, nullptr, nullptr),
CastInst::IntToPtr);
}
diff --git a/unittests/IR/LegacyPassManagerTest.cpp b/unittests/IR/LegacyPassManagerTest.cpp
index df6f460df9..9c2a835ca0 100644
--- a/unittests/IR/LegacyPassManagerTest.cpp
+++ b/unittests/IR/LegacyPassManagerTest.cpp
@@ -476,7 +476,7 @@ namespace llvm {
// Function: test1 (func_test1)
{
- BasicBlock* label_entry = BasicBlock::Create(getGlobalContext(), "entry",func_test1,0);
+ BasicBlock* label_entry = BasicBlock::Create(getGlobalContext(), "entry",func_test1,nullptr);
// Block entry (label_entry)
CallInst* int32_3 = CallInst::Create(func_test2, "", label_entry);
@@ -491,7 +491,7 @@ namespace llvm {
// Function: test2 (func_test2)
{
- BasicBlock* label_entry_5 = BasicBlock::Create(getGlobalContext(), "entry",func_test2,0);
+ BasicBlock* label_entry_5 = BasicBlock::Create(getGlobalContext(), "entry",func_test2,nullptr);
// Block entry (label_entry_5)
CallInst* int32_6 = CallInst::Create(func_test3, "", label_entry_5);
@@ -506,7 +506,7 @@ namespace llvm {
// Function: test3 (func_test3)
{
- BasicBlock* label_entry_8 = BasicBlock::Create(getGlobalContext(), "entry",func_test3,0);
+ BasicBlock* label_entry_8 = BasicBlock::Create(getGlobalContext(), "entry",func_test3,nullptr);
// Block entry (label_entry_8)
CallInst* int32_9 = CallInst::Create(func_test1, "", label_entry_8);
@@ -524,10 +524,10 @@ namespace llvm {
Value* int1_f = args++;
int1_f->setName("f");
- BasicBlock* label_entry_11 = BasicBlock::Create(getGlobalContext(), "entry",func_test4,0);
- BasicBlock* label_bb = BasicBlock::Create(getGlobalContext(), "bb",func_test4,0);
- BasicBlock* label_bb1 = BasicBlock::Create(getGlobalContext(), "bb1",func_test4,0);
- BasicBlock* label_return = BasicBlock::Create(getGlobalContext(), "return",func_test4,0);
+ BasicBlock* label_entry_11 = BasicBlock::Create(getGlobalContext(), "entry",func_test4,nullptr);
+ BasicBlock* label_bb = BasicBlock::Create(getGlobalContext(), "bb",func_test4,nullptr);
+ BasicBlock* label_bb1 = BasicBlock::Create(getGlobalContext(), "bb1",func_test4,nullptr);
+ BasicBlock* label_return = BasicBlock::Create(getGlobalContext(), "return",func_test4,nullptr);
// Block entry (label_entry_11)
BranchInst::Create(label_bb, label_entry_11);
diff --git a/unittests/IR/MDBuilderTest.cpp b/unittests/IR/MDBuilderTest.cpp
index c8b5a09e49..fc4674ea13 100644
--- a/unittests/IR/MDBuilderTest.cpp
+++ b/unittests/IR/MDBuilderTest.cpp
@@ -33,8 +33,8 @@ TEST_F(MDBuilderTest, createFPMath) {
MDBuilder MDHelper(Context);
MDNode *MD0 = MDHelper.createFPMath(0.0);
MDNode *MD1 = MDHelper.createFPMath(1.0);
- EXPECT_EQ(MD0, (MDNode *)0);
- EXPECT_NE(MD1, (MDNode *)0);
+ EXPECT_EQ(MD0, (MDNode *)nullptr);
+ EXPECT_NE(MD1, (MDNode *)nullptr);
EXPECT_EQ(MD1->getNumOperands(), 1U);
Value *Op = MD1->getOperand(0);
EXPECT_TRUE(isa<ConstantFP>(Op));
@@ -47,8 +47,8 @@ TEST_F(MDBuilderTest, createRangeMetadata) {
APInt A(8, 1), B(8, 2);
MDNode *R0 = MDHelper.createRange(A, A);
MDNode *R1 = MDHelper.createRange(A, B);
- EXPECT_EQ(R0, (MDNode *)0);
- EXPECT_NE(R1, (MDNode *)0);
+ EXPECT_EQ(R0, (MDNode *)nullptr);
+ EXPECT_NE(R1, (MDNode *)nullptr);
EXPECT_EQ(R1->getNumOperands(), 2U);
EXPECT_TRUE(isa<ConstantInt>(R1->getOperand(0)));
EXPECT_TRUE(isa<ConstantInt>(R1->getOperand(1)));
@@ -66,8 +66,8 @@ TEST_F(MDBuilderTest, createAnonymousTBAARoot) {
EXPECT_GE(R1->getNumOperands(), 1U);
EXPECT_EQ(R0->getOperand(0), R0);
EXPECT_EQ(R1->getOperand(0), R1);
- EXPECT_TRUE(R0->getNumOperands() == 1 || R0->getOperand(1) == 0);
- EXPECT_TRUE(R1->getNumOperands() == 1 || R1->getOperand(1) == 0);
+ EXPECT_TRUE(R0->getNumOperands() == 1 || R0->getOperand(1) == nullptr);
+ EXPECT_TRUE(R1->getNumOperands() == 1 || R1->getOperand(1) == nullptr);
}
TEST_F(MDBuilderTest, createTBAARoot) {
MDBuilder MDHelper(Context);
@@ -77,7 +77,7 @@ TEST_F(MDBuilderTest, createTBAARoot) {
EXPECT_GE(R0->getNumOperands(), 1U);
EXPECT_TRUE(isa<MDString>(R0->getOperand(0)));
EXPECT_EQ(cast<MDString>(R0->getOperand(0))->getString(), "Root");
- EXPECT_TRUE(R0->getNumOperands() == 1 || R0->getOperand(1) == 0);
+ EXPECT_TRUE(R0->getNumOperands() == 1 || R0->getOperand(1) == nullptr);
}
TEST_F(MDBuilderTest, createTBAANode) {
MDBuilder MDHelper(Context);
diff --git a/unittests/IR/MetadataTest.cpp b/unittests/IR/MetadataTest.cpp
index 00a2783fbf..4f7bd720d1 100644
--- a/unittests/IR/MetadataTest.cpp
+++ b/unittests/IR/MetadataTest.cpp
@@ -103,7 +103,7 @@ TEST_F(MDNodeTest, Simple) {
#endif
EXPECT_EQ(n4, n1);
EXPECT_EQ(n5, n2);
- EXPECT_EQ(n6, (Value*)0);
+ EXPECT_EQ(n6, (Value*)nullptr);
EXPECT_EQ(3u, n1->getNumOperands());
EXPECT_EQ(s1, n1->getOperand(0));
diff --git a/unittests/IR/PassManagerTest.cpp b/unittests/IR/PassManagerTest.cpp
index 310e48fc3b..25037a773c 100644
--- a/unittests/IR/PassManagerTest.cpp
+++ b/unittests/IR/PassManagerTest.cpp
@@ -168,7 +168,7 @@ struct TestInvalidationFunctionPass {
Module *parseIR(const char *IR) {
LLVMContext &C = getGlobalContext();
SMDiagnostic Err;
- return ParseAssemblyString(IR, 0, Err, C);
+ return ParseAssemblyString(IR, nullptr, Err, C);
}
class PassManagerTest : public ::testing::Test {
diff --git a/unittests/IR/PatternMatch.cpp b/unittests/IR/PatternMatch.cpp
index bebee15366..f3a27b8d25 100644
--- a/unittests/IR/PatternMatch.cpp
+++ b/unittests/IR/PatternMatch.cpp
@@ -230,17 +230,17 @@ TEST_F(PatternMatchTest, OverflowingBinOps) {
m_NSWAdd(m_Value(MatchL), m_Value(MatchR)).match(IRB.CreateNSWAdd(L, R)));
EXPECT_EQ(L, MatchL);
EXPECT_EQ(R, MatchR);
- MatchL = MatchR = 0;
+ MatchL = MatchR = nullptr;
EXPECT_TRUE(
m_NSWSub(m_Value(MatchL), m_Value(MatchR)).match(IRB.CreateNSWSub(L, R)));
EXPECT_EQ(L, MatchL);
EXPECT_EQ(R, MatchR);
- MatchL = MatchR = 0;
+ MatchL = MatchR = nullptr;
EXPECT_TRUE(
m_NSWMul(m_Value(MatchL), m_Value(MatchR)).match(IRB.CreateNSWMul(L, R)));
EXPECT_EQ(L, MatchL);
EXPECT_EQ(R, MatchR);
- MatchL = MatchR = 0;
+ MatchL = MatchR = nullptr;
EXPECT_TRUE(m_NSWShl(m_Value(MatchL), m_Value(MatchR)).match(
IRB.CreateShl(L, R, "", /* NUW */ false, /* NSW */ true)));
EXPECT_EQ(L, MatchL);
@@ -250,17 +250,17 @@ TEST_F(PatternMatchTest, OverflowingBinOps) {
m_NUWAdd(m_Value(MatchL), m_Value(MatchR)).match(IRB.CreateNUWAdd(L, R)));
EXPECT_EQ(L, MatchL);
EXPECT_EQ(R, MatchR);
- MatchL = MatchR = 0;
+ MatchL = MatchR = nullptr;
EXPECT_TRUE(
m_NUWSub(m_Value(MatchL), m_Value(MatchR)).match(IRB.CreateNUWSub(L, R)));
EXPECT_EQ(L, MatchL);
EXPECT_EQ(R, MatchR);
- MatchL = MatchR = 0;
+ MatchL = MatchR = nullptr;
EXPECT_TRUE(
m_NUWMul(m_Value(MatchL), m_Value(MatchR)).match(IRB.CreateNUWMul(L, R)));
EXPECT_EQ(L, MatchL);
EXPECT_EQ(R, MatchR);
- MatchL = MatchR = 0;
+ MatchL = MatchR = nullptr;
EXPECT_TRUE(m_NUWShl(m_Value(MatchL), m_Value(MatchR)).match(
IRB.CreateShl(L, R, "", /* NUW */ true, /* NSW */ false)));
EXPECT_EQ(L, MatchL);
diff --git a/unittests/IR/TypeBuilderTest.cpp b/unittests/IR/TypeBuilderTest.cpp
index be493cdc63..b7b3e45e35 100644
--- a/unittests/IR/TypeBuilderTest.cpp
+++ b/unittests/IR/TypeBuilderTest.cpp
@@ -234,19 +234,19 @@ TEST(TypeBuilderTest, Extensions) {
TypeBuilder<int, false>::get(getGlobalContext()),
TypeBuilder<int*, false>::get(getGlobalContext()),
TypeBuilder<void*[], false>::get(getGlobalContext()),
- (void*)0)),
+ (void*)nullptr)),
(TypeBuilder<MyType*, false>::get(getGlobalContext())));
EXPECT_EQ(PointerType::getUnqual(StructType::get(
TypeBuilder<types::i<32>, false>::get(getGlobalContext()),
TypeBuilder<types::i<32>*, false>::get(getGlobalContext()),
TypeBuilder<types::i<8>*[], false>::get(getGlobalContext()),
- (void*)0)),
+ (void*)nullptr)),
(TypeBuilder<MyPortableType*, false>::get(getGlobalContext())));
EXPECT_EQ(PointerType::getUnqual(StructType::get(
TypeBuilder<types::i<32>, false>::get(getGlobalContext()),
TypeBuilder<types::i<32>*, false>::get(getGlobalContext()),
TypeBuilder<types::i<8>*[], false>::get(getGlobalContext()),
- (void*)0)),
+ (void*)nullptr)),
(TypeBuilder<MyPortableType*, true>::get(getGlobalContext())));
}
diff --git a/unittests/IR/UserTest.cpp b/unittests/IR/UserTest.cpp
index 9c0e7b2750..eb07e824d8 100644
--- a/unittests/IR/UserTest.cpp
+++ b/unittests/IR/UserTest.cpp
@@ -65,7 +65,7 @@ TEST(UserTest, ValueOpIteration) {
" ret void\n"
"}\n";
SMDiagnostic Err;
- Module *M = ParseAssemblyString(ModuleString, NULL, Err, C);
+ Module *M = ParseAssemblyString(ModuleString, nullptr, Err, C);
Function *F = M->getFunction("f");
BasicBlock &ExitBB = F->back();
diff --git a/unittests/IR/ValueHandleTest.cpp b/unittests/IR/ValueHandleTest.cpp
index 15a0c226f7..403d2bcbda 100644
--- a/unittests/IR/ValueHandleTest.cpp
+++ b/unittests/IR/ValueHandleTest.cpp
@@ -94,7 +94,7 @@ TEST_F(ValueHandle, WeakVH_NullOnDeletion) {
WeakVH WVH_Copy(WVH);
WeakVH WVH_Recreated(BitcastV.get());
BitcastV.reset();
- Value *null_value = NULL;
+ Value *null_value = nullptr;
EXPECT_EQ(null_value, WVH);
EXPECT_EQ(null_value, WVH_Copy);
EXPECT_EQ(null_value, WVH_Recreated);
@@ -178,10 +178,10 @@ TEST_F(ValueHandle, AssertingVH_Asserts) {
EXPECT_DEATH({BitcastV.reset();},
"An asserting value handle still pointed to this value!");
AssertingVH<Value> Copy(AVH);
- AVH = NULL;
+ AVH = nullptr;
EXPECT_DEATH({BitcastV.reset();},
"An asserting value handle still pointed to this value!");
- Copy = NULL;
+ Copy = nullptr;
BitcastV.reset();
}
@@ -263,14 +263,14 @@ TEST_F(ValueHandle, CallbackVH_CallbackOnRAUW) {
int DeletedCalls;
Value *AURWArgument;
- RecordingVH() : DeletedCalls(0), AURWArgument(NULL) {}
+ RecordingVH() : DeletedCalls(0), AURWArgument(nullptr) {}
RecordingVH(Value *V)
- : CallbackVH(V), DeletedCalls(0), AURWArgument(NULL) {}
+ : CallbackVH(V), DeletedCalls(0), AURWArgument(nullptr) {}
private:
virtual void deleted() { DeletedCalls++; CallbackVH::deleted(); }
virtual void allUsesReplacedWith(Value *new_value) {
- EXPECT_EQ(NULL, AURWArgument);
+ EXPECT_EQ(nullptr, AURWArgument);
AURWArgument = new_value;
}
};
@@ -278,7 +278,7 @@ TEST_F(ValueHandle, CallbackVH_CallbackOnRAUW) {
RecordingVH RVH;
RVH = BitcastV.get();
EXPECT_EQ(0, RVH.DeletedCalls);
- EXPECT_EQ(NULL, RVH.AURWArgument);
+ EXPECT_EQ(nullptr, RVH.AURWArgument);
BitcastV->replaceAllUsesWith(ConstantV);
EXPECT_EQ(0, RVH.DeletedCalls);
EXPECT_EQ(ConstantV, RVH.AURWArgument);
@@ -291,21 +291,21 @@ TEST_F(ValueHandle, CallbackVH_DeletionCanRAUW) {
Value *AURWArgument;
LLVMContext *Context;
- RecoveringVH() : DeletedCalls(0), AURWArgument(NULL),
+ RecoveringVH() : DeletedCalls(0), AURWArgument(nullptr),
Context(&getGlobalContext()) {}
RecoveringVH(Value *V)
- : CallbackVH(V), DeletedCalls(0), AURWArgument(NULL),
+ : CallbackVH(V), DeletedCalls(0), AURWArgument(nullptr),
Context(&getGlobalContext()) {}
private:
virtual void deleted() {
getValPtr()->replaceAllUsesWith(Constant::getNullValue(Type::getInt32Ty(getGlobalContext())));
- setValPtr(NULL);
+ setValPtr(nullptr);
}
virtual void allUsesReplacedWith(Value *new_value) {
- ASSERT_TRUE(NULL != getValPtr());
+ ASSERT_TRUE(nullptr != getValPtr());
EXPECT_EQ(1U, getValPtr()->getNumUses());
- EXPECT_EQ(NULL, AURWArgument);
+ EXPECT_EQ(nullptr, AURWArgument);
AURWArgument = new_value;
}
};
@@ -368,8 +368,8 @@ TEST_F(ValueHandle, DestroyingOtherVHOnSameValueDoesntBreakIteration) {
WeakVH ShouldBeVisited2(BitcastV.get());
BitcastV.reset();
- EXPECT_EQ(NULL, static_cast<Value*>(ShouldBeVisited1));
- EXPECT_EQ(NULL, static_cast<Value*>(ShouldBeVisited2));
+ EXPECT_EQ(nullptr, static_cast<Value*>(ShouldBeVisited1));
+ EXPECT_EQ(nullptr, static_cast<Value*>(ShouldBeVisited2));
}
}
@@ -389,8 +389,8 @@ TEST_F(ValueHandle, AssertingVHCheckedLast) {
}
virtual void deleted() {
- *ToClear[0] = 0;
- *ToClear[1] = 0;
+ *ToClear[0] = nullptr;
+ *ToClear[1] = nullptr;
CallbackVH::deleted();
}
};
diff --git a/unittests/IR/ValueMapTest.cpp b/unittests/IR/ValueMapTest.cpp
index 6fd87b1e0c..3427c91332 100644
--- a/unittests/IR/ValueMapTest.cpp
+++ b/unittests/IR/ValueMapTest.cpp
@@ -40,8 +40,8 @@ TYPED_TEST_CASE(ValueMapTest, KeyTypes);
TYPED_TEST(ValueMapTest, Null) {
ValueMap<TypeParam*, int> VM1;
- VM1[NULL] = 7;
- EXPECT_EQ(7, VM1.lookup(NULL));
+ VM1[nullptr] = 7;
+ EXPECT_EQ(7, VM1.lookup(nullptr));
}
TYPED_TEST(ValueMapTest, FollowsValue) {
diff --git a/unittests/IR/ValueTest.cpp b/unittests/IR/ValueTest.cpp
index d92bc82768..61e44a908d 100644
--- a/unittests/IR/ValueTest.cpp
+++ b/unittests/IR/ValueTest.cpp
@@ -34,7 +34,7 @@ TEST(ValueTest, UsedInBasicBlock) {
" ret void\n"
"}\n";
SMDiagnostic Err;
- Module *M = ParseAssemblyString(ModuleString, NULL, Err, C);
+ Module *M = ParseAssemblyString(ModuleString, nullptr, Err, C);
Function *F = M->getFunction("f");
@@ -56,7 +56,7 @@ TEST(GlobalTest, CreateAddressSpace) {
GlobalValue::ExternalLinkage,
Constant::getAllOnesValue(Int32Ty),
"dummy",
- 0,
+ nullptr,
GlobalVariable::NotThreadLocal,
1);
@@ -74,7 +74,7 @@ TEST(GlobalTest, CreateAddressSpace) {
GlobalValue::ExternalLinkage,
Constant::getAllOnesValue(Int32Ty),
"dummy_cast",
- 0,
+ nullptr,
GlobalVariable::NotThreadLocal,
1);
diff --git a/unittests/IR/WaymarkTest.cpp b/unittests/IR/WaymarkTest.cpp
index 9a9b4a2ad4..8e3cd45808 100644
--- a/unittests/IR/WaymarkTest.cpp
+++ b/unittests/IR/WaymarkTest.cpp
@@ -31,7 +31,7 @@ TEST(WaymarkTest, NativeArray) {
FunctionType *FT = FunctionType::get(Type::getVoidTy(getGlobalContext()), true);
Function *F = Function::Create(FT, GlobalValue::ExternalLinkage);
const CallInst *A = CallInst::Create(F, makeArrayRef(values));
- ASSERT_NE(A, (const CallInst*)NULL);
+ ASSERT_NE(A, (const CallInst*)nullptr);
ASSERT_EQ(1U + 22, A->getNumOperands());
const Use *U = &A->getOperandUse(0);
const Use *Ue = &A->getOperandUse(22);