summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Analysis
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2014-06-08 22:29:17 +0000
committerCraig Topper <craig.topper@gmail.com>2014-06-08 22:29:17 +0000
commit66f09ad0417c0e9f0c959023c1cdfcf2d881ad2e (patch)
treeb9db3c4a6ee223002b945659169ab39cdd9fd80d /llvm/unittests/Analysis
parent41181d140c99913f8c8d73791dd4babfcba8a73d (diff)
downloadbcm5719-llvm-66f09ad0417c0e9f0c959023c1cdfcf2d881ad2e.tar.gz
bcm5719-llvm-66f09ad0417c0e9f0c959023c1cdfcf2d881ad2e.zip
[C++11] Use 'nullptr'.
llvm-svn: 210442
Diffstat (limited to 'llvm/unittests/Analysis')
-rw-r--r--llvm/unittests/Analysis/CFGTest.cpp17
-rw-r--r--llvm/unittests/Analysis/MixedTBAATest.cpp2
-rw-r--r--llvm/unittests/Analysis/ScalarEvolutionTest.cpp4
3 files changed, 12 insertions, 11 deletions
diff --git a/llvm/unittests/Analysis/CFGTest.cpp b/llvm/unittests/Analysis/CFGTest.cpp
index 8d8c560d9e3..ac5e71061d8 100644
--- a/llvm/unittests/Analysis/CFGTest.cpp
+++ b/llvm/unittests/Analysis/CFGTest.cpp
@@ -46,10 +46,10 @@ protected:
}
Function *F = M->getFunction("test");
- if (F == NULL)
+ if (F == nullptr)
report_fatal_error("Test must have a function named @test");
- A = B = NULL;
+ A = B = nullptr;
for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) {
if (I->hasName()) {
if (I->getName() == "A")
@@ -58,9 +58,9 @@ protected:
B = &*I;
}
}
- if (A == NULL)
+ if (A == nullptr)
report_fatal_error("@test must have an instruction %A");
- if (B == NULL)
+ if (B == nullptr)
report_fatal_error("@test must have an instruction %B");
}
@@ -74,7 +74,7 @@ protected:
static int initialize() {
PassInfo *PI = new PassInfo("isPotentiallyReachable testing pass",
- "", &ID, 0, true, true);
+ "", &ID, nullptr, true, true);
PassRegistry::getPassRegistry()->registerPass(*PI, false);
initializeLoopInfoPass(*PassRegistry::getPassRegistry());
initializeDominatorTreeWrapperPassPass(
@@ -95,9 +95,10 @@ protected:
LoopInfo *LI = &getAnalysis<LoopInfo>();
DominatorTree *DT =
&getAnalysis<DominatorTreeWrapperPass>().getDomTree();
- EXPECT_EQ(isPotentiallyReachable(A, B, 0, 0), ExpectedResult);
- EXPECT_EQ(isPotentiallyReachable(A, B, DT, 0), ExpectedResult);
- EXPECT_EQ(isPotentiallyReachable(A, B, 0, LI), ExpectedResult);
+ EXPECT_EQ(isPotentiallyReachable(A, B, nullptr, nullptr),
+ ExpectedResult);
+ EXPECT_EQ(isPotentiallyReachable(A, B, DT, nullptr), ExpectedResult);
+ EXPECT_EQ(isPotentiallyReachable(A, B, nullptr, LI), ExpectedResult);
EXPECT_EQ(isPotentiallyReachable(A, B, DT, LI), ExpectedResult);
return false;
}
diff --git a/llvm/unittests/Analysis/MixedTBAATest.cpp b/llvm/unittests/Analysis/MixedTBAATest.cpp
index 2cf7c734dc6..142e04789d4 100644
--- a/llvm/unittests/Analysis/MixedTBAATest.cpp
+++ b/llvm/unittests/Analysis/MixedTBAATest.cpp
@@ -43,7 +43,7 @@ TEST_F(MixedTBAATest, MixedTBAA) {
auto *Store1 = new StoreInst(Value, Addr, BB);
auto *Store2 = new StoreInst(Value, Addr, BB);
- ReturnInst::Create(C, 0, BB);
+ ReturnInst::Create(C, nullptr, BB);
// New TBAA metadata
{
diff --git a/llvm/unittests/Analysis/ScalarEvolutionTest.cpp b/llvm/unittests/Analysis/ScalarEvolutionTest.cpp
index 398d09e5a87..90f6997e98c 100644
--- a/llvm/unittests/Analysis/ScalarEvolutionTest.cpp
+++ b/llvm/unittests/Analysis/ScalarEvolutionTest.cpp
@@ -41,7 +41,7 @@ TEST_F(ScalarEvolutionsTest, SCEVUnknownRAUW) {
std::vector<Type *>(), false);
Function *F = cast<Function>(M.getOrInsertFunction("f", FTy));
BasicBlock *BB = BasicBlock::Create(Context, "entry", F);
- ReturnInst::Create(Context, 0, BB);
+ ReturnInst::Create(Context, nullptr, BB);
Type *Ty = Type::getInt1Ty(Context);
Constant *Init = Constant::getNullValue(Ty);
@@ -94,7 +94,7 @@ TEST_F(ScalarEvolutionsTest, SCEVMultiplyAddRecs) {
FunctionType *FTy = FunctionType::get(Type::getVoidTy(Context), Types, false);
Function *F = cast<Function>(M.getOrInsertFunction("f", FTy));
BasicBlock *BB = BasicBlock::Create(Context, "entry", F);
- ReturnInst::Create(Context, 0, BB);
+ ReturnInst::Create(Context, nullptr, BB);
// Create a ScalarEvolution and "run" it so that it gets initialized.
PM.add(&SE);
OpenPOWER on IntegriCloud