summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/IR
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/IR')
-rw-r--r--llvm/unittests/IR/DominatorTreeTest.cpp28
-rw-r--r--llvm/unittests/IR/IRBuilderTest.cpp4
-rw-r--r--llvm/unittests/IR/LegacyPassManagerTest.cpp2
-rw-r--r--llvm/unittests/IR/ValueTest.cpp18
4 files changed, 26 insertions, 26 deletions
diff --git a/llvm/unittests/IR/DominatorTreeTest.cpp b/llvm/unittests/IR/DominatorTreeTest.cpp
index 146ec576dba..3aef4d64cbc 100644
--- a/llvm/unittests/IR/DominatorTreeTest.cpp
+++ b/llvm/unittests/IR/DominatorTreeTest.cpp
@@ -32,29 +32,29 @@ namespace llvm {
PostDominatorTree *PDT = &getAnalysis<PostDominatorTree>();
Function::iterator FI = F.begin();
- BasicBlock *BB0 = FI++;
+ BasicBlock *BB0 = &*FI++;
BasicBlock::iterator BBI = BB0->begin();
- Instruction *Y1 = BBI++;
- Instruction *Y2 = BBI++;
- Instruction *Y3 = BBI++;
+ Instruction *Y1 = &*BBI++;
+ Instruction *Y2 = &*BBI++;
+ Instruction *Y3 = &*BBI++;
- BasicBlock *BB1 = FI++;
+ BasicBlock *BB1 = &*FI++;
BBI = BB1->begin();
- Instruction *Y4 = BBI++;
+ Instruction *Y4 = &*BBI++;
- BasicBlock *BB2 = FI++;
+ BasicBlock *BB2 = &*FI++;
BBI = BB2->begin();
- Instruction *Y5 = BBI++;
+ Instruction *Y5 = &*BBI++;
- BasicBlock *BB3 = FI++;
+ BasicBlock *BB3 = &*FI++;
BBI = BB3->begin();
- Instruction *Y6 = BBI++;
- Instruction *Y7 = BBI++;
+ Instruction *Y6 = &*BBI++;
+ Instruction *Y7 = &*BBI++;
- BasicBlock *BB4 = FI++;
+ BasicBlock *BB4 = &*FI++;
BBI = BB4->begin();
- Instruction *Y8 = BBI++;
- Instruction *Y9 = BBI++;
+ Instruction *Y8 = &*BBI++;
+ Instruction *Y9 = &*BBI++;
// Reachability
EXPECT_TRUE(DT->isReachableFromEntry(BB0));
diff --git a/llvm/unittests/IR/IRBuilderTest.cpp b/llvm/unittests/IR/IRBuilderTest.cpp
index 30e137cadbc..5f3aac05b11 100644
--- a/llvm/unittests/IR/IRBuilderTest.cpp
+++ b/llvm/unittests/IR/IRBuilderTest.cpp
@@ -299,7 +299,7 @@ TEST_F(IRBuilderTest, RAIIHelpersTest) {
{
IRBuilder<>::InsertPointGuard Guard(Builder);
Builder.SetInsertPoint(cast<Instruction>(F));
- EXPECT_EQ(F, Builder.GetInsertPoint());
+ EXPECT_EQ(F, &*Builder.GetInsertPoint());
}
EXPECT_EQ(BB->end(), Builder.GetInsertPoint());
@@ -379,7 +379,7 @@ TEST_F(IRBuilderTest, DebugLoc) {
EXPECT_EQ(DL1, Call1->getDebugLoc());
Call1->setDebugLoc(DL2);
- Builder.SetInsertPoint(Call1->getParent(), Call1);
+ Builder.SetInsertPoint(Call1->getParent(), Call1->getIterator());
EXPECT_EQ(DL2, Builder.getCurrentDebugLocation());
auto Call2 = Builder.CreateCall(Callee, None);
EXPECT_EQ(DL2, Call2->getDebugLoc());
diff --git a/llvm/unittests/IR/LegacyPassManagerTest.cpp b/llvm/unittests/IR/LegacyPassManagerTest.cpp
index 66fd1ccd7f2..1f88283dc0c 100644
--- a/llvm/unittests/IR/LegacyPassManagerTest.cpp
+++ b/llvm/unittests/IR/LegacyPassManagerTest.cpp
@@ -510,7 +510,7 @@ namespace llvm {
// Function: test4 (func_test4)
{
Function::arg_iterator args = func_test4->arg_begin();
- Value* int1_f = args++;
+ Value *int1_f = &*args++;
int1_f->setName("f");
BasicBlock* label_entry_11 = BasicBlock::Create(getGlobalContext(), "entry",func_test4,nullptr);
diff --git a/llvm/unittests/IR/ValueTest.cpp b/llvm/unittests/IR/ValueTest.cpp
index 7a4c2f696f7..9cf1306dae6 100644
--- a/llvm/unittests/IR/ValueTest.cpp
+++ b/llvm/unittests/IR/ValueTest.cpp
@@ -39,9 +39,9 @@ TEST(ValueTest, UsedInBasicBlock) {
Function *F = M->getFunction("f");
- EXPECT_FALSE(F->isUsedInBasicBlock(F->begin()));
- EXPECT_TRUE((++F->arg_begin())->isUsedInBasicBlock(F->begin()));
- EXPECT_TRUE(F->arg_begin()->isUsedInBasicBlock(F->begin()));
+ EXPECT_FALSE(F->isUsedInBasicBlock(&F->front()));
+ EXPECT_TRUE((++F->arg_begin())->isUsedInBasicBlock(&F->front()));
+ EXPECT_TRUE(F->arg_begin()->isUsedInBasicBlock(&F->front()));
}
TEST(GlobalTest, CreateAddressSpace) {
@@ -127,9 +127,9 @@ TEST(ValueTest, printSlots) {
BasicBlock &BB = F->getEntryBlock();
ASSERT_EQ(3u, BB.size());
- Instruction *I0 = BB.begin();
+ Instruction *I0 = &*BB.begin();
ASSERT_TRUE(I0);
- Instruction *I1 = ++BB.begin();
+ Instruction *I1 = &*++BB.begin();
ASSERT_TRUE(I1);
ModuleSlotTracker MST(M.get());
@@ -194,12 +194,12 @@ TEST(ValueTest, getLocalSlots) {
ASSERT_FALSE(F->empty());
BasicBlock &EntryBB = F->getEntryBlock();
ASSERT_EQ(3u, EntryBB.size());
- BasicBlock *BB2 = ++F->begin();
+ BasicBlock *BB2 = &*++F->begin();
ASSERT_TRUE(BB2);
- Instruction *I0 = EntryBB.begin();
+ Instruction *I0 = &*EntryBB.begin();
ASSERT_TRUE(I0);
- Instruction *I1 = ++EntryBB.begin();
+ Instruction *I1 = &*++EntryBB.begin();
ASSERT_TRUE(I1);
ModuleSlotTracker MST(M.get());
@@ -227,7 +227,7 @@ TEST(ValueTest, getLocalSlotDeath) {
Function *F = M->getFunction("f");
ASSERT_TRUE(F);
ASSERT_FALSE(F->empty());
- BasicBlock *BB2 = ++F->begin();
+ BasicBlock *BB2 = &*++F->begin();
ASSERT_TRUE(BB2);
ModuleSlotTracker MST(M.get());
OpenPOWER on IntegriCloud