summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-10-08 23:49:46 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-10-08 23:49:46 +0000
commit52888a673859a5047acd08d60b43f173d126c8e7 (patch)
tree9ef0445b493863e9e6e4a7fa269e91ba8bab0f58 /llvm/lib/IR
parent5a9640be324cf3ede6aa6ba714266b3bddf32db4 (diff)
downloadbcm5719-llvm-52888a673859a5047acd08d60b43f173d126c8e7.tar.gz
bcm5719-llvm-52888a673859a5047acd08d60b43f173d126c8e7.zip
IR: Remove implicit iterator conversions from lib/IR, NFC
Stop converting implicitly between iterators and pointers/references in lib/IR. For convenience, I've added a `getIterator()` accessor to `ilist_node` so that callers don't need to know how to spell the iterator class (i.e., they can use `X.getIterator()` instead of `Function::iterator(X)`). I'll eventually disallow these implicit conversions entirely, but there's a lot of code, so it doesn't make sense to do it all in one patch. One library or so at a time. Why? To root out cases of `getNextNode()` and `getPrevNode()` being used in iterator logic. The design of `ilist` makes that invalid when the current node could be at the back of the list, but it happens to "work" right now because of a bug where those functions never return `nullptr` if you're using a half-node sentinel. Before I can fix the function, I have to remove uses of it that rely on it misbehaving. (Maybe the function should just be deleted anyway? But I don't want deleting it -- potentially a huge project -- to block fixing ilist/iplist.) llvm-svn: 249782
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/AsmWriter.cpp4
-rw-r--r--llvm/lib/IR/AutoUpgrade.cpp4
-rw-r--r--llvm/lib/IR/BasicBlock.cpp18
-rw-r--r--llvm/lib/IR/Core.cpp70
-rw-r--r--llvm/lib/IR/DebugInfo.cpp2
-rw-r--r--llvm/lib/IR/Function.cpp4
-rw-r--r--llvm/lib/IR/Globals.cpp10
-rw-r--r--llvm/lib/IR/Instruction.cpp15
-rw-r--r--llvm/lib/IR/Module.cpp2
-rw-r--r--llvm/lib/IR/SymbolTableListTraitsImpl.h2
-rw-r--r--llvm/lib/IR/TypeFinder.cpp4
-rw-r--r--llvm/lib/IR/Verifier.cpp4
12 files changed, 72 insertions, 67 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index b4d7a660688..2b39f2273b3 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -817,7 +817,7 @@ void SlotTracker::processFunction() {
for(Function::const_arg_iterator AI = TheFunction->arg_begin(),
AE = TheFunction->arg_end(); AI != AE; ++AI)
if (!AI->hasName())
- CreateFunctionSlot(AI);
+ CreateFunctionSlot(&*AI);
ST_DEBUG("Inserting Instructions:\n");
@@ -2635,7 +2635,7 @@ void AssemblyWriter::printFunction(const Function *F) {
Out << " {";
// Output all of the function's basic blocks.
for (Function::const_iterator I = F->begin(), E = F->end(); I != E; ++I)
- printBasicBlock(I);
+ printBasicBlock(&*I);
// Output the function's use-lists.
printUseLists(F);
diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp
index 6c9fdd6fcea..5ffe288efb6 100644
--- a/llvm/lib/IR/AutoUpgrade.cpp
+++ b/llvm/lib/IR/AutoUpgrade.cpp
@@ -362,7 +362,7 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) {
Function *F = CI->getCalledFunction();
LLVMContext &C = CI->getContext();
IRBuilder<> Builder(C);
- Builder.SetInsertPoint(CI->getParent(), CI);
+ Builder.SetInsertPoint(CI->getParent(), CI->getIterator());
assert(F && "Intrinsic call is not direct?");
@@ -388,7 +388,7 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) {
Name == "llvm.x86.avx.movnt.ps.256" ||
Name == "llvm.x86.avx.movnt.pd.256") {
IRBuilder<> Builder(C);
- Builder.SetInsertPoint(CI->getParent(), CI);
+ Builder.SetInsertPoint(CI->getParent(), CI->getIterator());
Module *M = F->getParent();
SmallVector<Metadata *, 1> Elts;
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp
index 02e07eb5bb5..f61276fd436 100644
--- a/llvm/lib/IR/BasicBlock.cpp
+++ b/llvm/lib/IR/BasicBlock.cpp
@@ -56,7 +56,7 @@ void BasicBlock::insertInto(Function *NewParent, BasicBlock *InsertBefore) {
assert(!Parent && "Already has a parent");
if (InsertBefore)
- NewParent->getBasicBlockList().insert(InsertBefore, this);
+ NewParent->getBasicBlockList().insert(InsertBefore->getIterator(), this);
else
NewParent->getBasicBlockList().push_back(this);
}
@@ -91,26 +91,26 @@ void BasicBlock::setParent(Function *parent) {
}
void BasicBlock::removeFromParent() {
- getParent()->getBasicBlockList().remove(this);
+ getParent()->getBasicBlockList().remove(getIterator());
}
iplist<BasicBlock>::iterator BasicBlock::eraseFromParent() {
- return getParent()->getBasicBlockList().erase(this);
+ return getParent()->getBasicBlockList().erase(getIterator());
}
/// Unlink this basic block from its current function and
/// insert it into the function that MovePos lives in, right before MovePos.
void BasicBlock::moveBefore(BasicBlock *MovePos) {
- MovePos->getParent()->getBasicBlockList().splice(MovePos,
- getParent()->getBasicBlockList(), this);
+ MovePos->getParent()->getBasicBlockList().splice(
+ MovePos->getIterator(), getParent()->getBasicBlockList(), getIterator());
}
/// Unlink this basic block from its current function and
/// insert it into the function that MovePos lives in, right after MovePos.
void BasicBlock::moveAfter(BasicBlock *MovePos) {
- Function::iterator I = MovePos;
- MovePos->getParent()->getBasicBlockList().splice(++I,
- getParent()->getBasicBlockList(), this);
+ MovePos->getParent()->getBasicBlockList().splice(
+ ++MovePos->getIterator(), getParent()->getBasicBlockList(),
+ getIterator());
}
const Module *BasicBlock::getModule() const {
@@ -196,7 +196,7 @@ BasicBlock::iterator BasicBlock::getFirstInsertionPt() {
if (!FirstNonPHI)
return end();
- iterator InsertPt = FirstNonPHI;
+ iterator InsertPt = FirstNonPHI->getIterator();
if (InsertPt->isEHPad()) ++InsertPt;
return InsertPt;
}
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp
index 22413297796..7f39c8085a6 100644
--- a/llvm/lib/IR/Core.cpp
+++ b/llvm/lib/IR/Core.cpp
@@ -1533,7 +1533,7 @@ LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M) {
Module::global_iterator I = Mod->global_begin();
if (I == Mod->global_end())
return nullptr;
- return wrap(I);
+ return wrap(&*I);
}
LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M) {
@@ -1541,23 +1541,23 @@ LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M) {
Module::global_iterator I = Mod->global_end();
if (I == Mod->global_begin())
return nullptr;
- return wrap(--I);
+ return wrap(&*--I);
}
LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar) {
GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar);
- Module::global_iterator I = GV;
+ Module::global_iterator I(GV);
if (++I == GV->getParent()->global_end())
return nullptr;
- return wrap(I);
+ return wrap(&*I);
}
LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar) {
GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar);
- Module::global_iterator I = GV;
+ Module::global_iterator I(GV);
if (I == GV->getParent()->global_begin())
return nullptr;
- return wrap(--I);
+ return wrap(&*--I);
}
void LLVMDeleteGlobal(LLVMValueRef GlobalVar) {
@@ -1666,7 +1666,7 @@ LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M) {
Module::iterator I = Mod->begin();
if (I == Mod->end())
return nullptr;
- return wrap(I);
+ return wrap(&*I);
}
LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M) {
@@ -1674,23 +1674,23 @@ LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M) {
Module::iterator I = Mod->end();
if (I == Mod->begin())
return nullptr;
- return wrap(--I);
+ return wrap(&*--I);
}
LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn) {
Function *Func = unwrap<Function>(Fn);
- Module::iterator I = Func;
+ Module::iterator I(Func);
if (++I == Func->getParent()->end())
return nullptr;
- return wrap(I);
+ return wrap(&*I);
}
LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn) {
Function *Func = unwrap<Function>(Fn);
- Module::iterator I = Func;
+ Module::iterator I(Func);
if (I == Func->getParent()->begin())
return nullptr;
- return wrap(--I);
+ return wrap(&*--I);
}
void LLVMDeleteFunction(LLVMValueRef Fn) {
@@ -1785,14 +1785,14 @@ void LLVMGetParams(LLVMValueRef FnRef, LLVMValueRef *ParamRefs) {
Function *Fn = unwrap<Function>(FnRef);
for (Function::arg_iterator I = Fn->arg_begin(),
E = Fn->arg_end(); I != E; I++)
- *ParamRefs++ = wrap(I);
+ *ParamRefs++ = wrap(&*I);
}
LLVMValueRef LLVMGetParam(LLVMValueRef FnRef, unsigned index) {
Function::arg_iterator AI = unwrap<Function>(FnRef)->arg_begin();
while (index --> 0)
AI++;
- return wrap(AI);
+ return wrap(&*AI);
}
LLVMValueRef LLVMGetParamParent(LLVMValueRef V) {
@@ -1804,7 +1804,7 @@ LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn) {
Function::arg_iterator I = Func->arg_begin();
if (I == Func->arg_end())
return nullptr;
- return wrap(I);
+ return wrap(&*I);
}
LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn) {
@@ -1812,23 +1812,23 @@ LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn) {
Function::arg_iterator I = Func->arg_end();
if (I == Func->arg_begin())
return nullptr;
- return wrap(--I);
+ return wrap(&*--I);
}
LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg) {
Argument *A = unwrap<Argument>(Arg);
- Function::arg_iterator I = A;
+ Function::arg_iterator I(A);
if (++I == A->getParent()->arg_end())
return nullptr;
- return wrap(I);
+ return wrap(&*I);
}
LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg) {
Argument *A = unwrap<Argument>(Arg);
- Function::arg_iterator I = A;
+ Function::arg_iterator I(A);
if (I == A->getParent()->arg_begin())
return nullptr;
- return wrap(--I);
+ return wrap(&*--I);
}
void LLVMAddAttribute(LLVMValueRef Arg, LLVMAttribute PA) {
@@ -1886,7 +1886,7 @@ unsigned LLVMCountBasicBlocks(LLVMValueRef FnRef) {
void LLVMGetBasicBlocks(LLVMValueRef FnRef, LLVMBasicBlockRef *BasicBlocksRefs){
Function *Fn = unwrap<Function>(FnRef);
for (Function::iterator I = Fn->begin(), E = Fn->end(); I != E; I++)
- *BasicBlocksRefs++ = wrap(I);
+ *BasicBlocksRefs++ = wrap(&*I);
}
LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn) {
@@ -1898,7 +1898,7 @@ LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn) {
Function::iterator I = Func->begin();
if (I == Func->end())
return nullptr;
- return wrap(I);
+ return wrap(&*I);
}
LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn) {
@@ -1906,23 +1906,23 @@ LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn) {
Function::iterator I = Func->end();
if (I == Func->begin())
return nullptr;
- return wrap(--I);
+ return wrap(&*--I);
}
LLVMBasicBlockRef LLVMGetNextBasicBlock(LLVMBasicBlockRef BB) {
BasicBlock *Block = unwrap(BB);
- Function::iterator I = Block;
+ Function::iterator I(Block);
if (++I == Block->getParent()->end())
return nullptr;
- return wrap(I);
+ return wrap(&*I);
}
LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB) {
BasicBlock *Block = unwrap(BB);
- Function::iterator I = Block;
+ Function::iterator I(Block);
if (I == Block->getParent()->begin())
return nullptr;
- return wrap(--I);
+ return wrap(&*--I);
}
LLVMBasicBlockRef LLVMAppendBasicBlockInContext(LLVMContextRef C,
@@ -1974,7 +1974,7 @@ LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB) {
BasicBlock::iterator I = Block->begin();
if (I == Block->end())
return nullptr;
- return wrap(I);
+ return wrap(&*I);
}
LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB) {
@@ -1982,23 +1982,23 @@ LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB) {
BasicBlock::iterator I = Block->end();
if (I == Block->begin())
return nullptr;
- return wrap(--I);
+ return wrap(&*--I);
}
LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst) {
Instruction *Instr = unwrap<Instruction>(Inst);
- BasicBlock::iterator I = Instr;
+ BasicBlock::iterator I(Instr);
if (++I == Instr->getParent()->end())
return nullptr;
- return wrap(I);
+ return wrap(&*I);
}
LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst) {
Instruction *Instr = unwrap<Instruction>(Inst);
- BasicBlock::iterator I = Instr;
+ BasicBlock::iterator I(Instr);
if (I == Instr->getParent()->begin())
return nullptr;
- return wrap(--I);
+ return wrap(&*--I);
}
void LLVMInstructionEraseFromParent(LLVMValueRef Inst) {
@@ -2166,12 +2166,12 @@ void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block,
LLVMValueRef Instr) {
BasicBlock *BB = unwrap(Block);
Instruction *I = Instr? unwrap<Instruction>(Instr) : (Instruction*) BB->end();
- unwrap(Builder)->SetInsertPoint(BB, I);
+ unwrap(Builder)->SetInsertPoint(BB, I->getIterator());
}
void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr) {
Instruction *I = unwrap<Instruction>(Instr);
- unwrap(Builder)->SetInsertPoint(I->getParent(), I);
+ unwrap(Builder)->SetInsertPoint(I->getParent(), I->getIterator());
}
void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block) {
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 55e46b36a14..b22ba53645d 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -336,7 +336,7 @@ bool llvm::StripDebugInfo(Module &M) {
for (Module::named_metadata_iterator NMI = M.named_metadata_begin(),
NME = M.named_metadata_end(); NMI != NME;) {
- NamedMDNode *NMD = NMI;
+ NamedMDNode *NMD = &*NMI;
++NMI;
if (NMD->getName().startswith("llvm.dbg.")) {
NMD->eraseFromParent();
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index 3935a33d170..3a1c7a4ca36 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -235,11 +235,11 @@ Type *Function::getReturnType() const {
}
void Function::removeFromParent() {
- getParent()->getFunctionList().remove(this);
+ getParent()->getFunctionList().remove(getIterator());
}
void Function::eraseFromParent() {
- getParent()->getFunctionList().erase(this);
+ getParent()->getFunctionList().erase(getIterator());
}
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/IR/Globals.cpp b/llvm/lib/IR/Globals.cpp
index 11ece2ed1b1..8fde4b8e9d7 100644
--- a/llvm/lib/IR/Globals.cpp
+++ b/llvm/lib/IR/Globals.cpp
@@ -178,7 +178,7 @@ GlobalVariable::GlobalVariable(Module &M, Type *Ty, bool constant,
}
if (Before)
- Before->getParent()->getGlobalList().insert(Before, this);
+ Before->getParent()->getGlobalList().insert(Before->getIterator(), this);
else
M.getGlobalList().push_back(this);
}
@@ -188,11 +188,11 @@ void GlobalVariable::setParent(Module *parent) {
}
void GlobalVariable::removeFromParent() {
- getParent()->getGlobalList().remove(this);
+ getParent()->getGlobalList().remove(getIterator());
}
void GlobalVariable::eraseFromParent() {
- getParent()->getGlobalList().erase(this);
+ getParent()->getGlobalList().erase(getIterator());
}
void GlobalVariable::setInitializer(Constant *InitVal) {
@@ -276,11 +276,11 @@ void GlobalAlias::setParent(Module *parent) {
}
void GlobalAlias::removeFromParent() {
- getParent()->getAliasList().remove(this);
+ getParent()->getAliasList().remove(getIterator());
}
void GlobalAlias::eraseFromParent() {
- getParent()->getAliasList().erase(this);
+ getParent()->getAliasList().erase(getIterator());
}
void GlobalAlias::setAliasee(Constant *Aliasee) {
diff --git a/llvm/lib/IR/Instruction.cpp b/llvm/lib/IR/Instruction.cpp
index 91ac83c10d4..b5a30a4969b 100644
--- a/llvm/lib/IR/Instruction.cpp
+++ b/llvm/lib/IR/Instruction.cpp
@@ -28,7 +28,7 @@ Instruction::Instruction(Type *ty, unsigned it, Use *Ops, unsigned NumOps,
if (InsertBefore) {
BasicBlock *BB = InsertBefore->getParent();
assert(BB && "Instruction to insert before is not in a basic block!");
- BB->getInstList().insert(InsertBefore, this);
+ BB->getInstList().insert(InsertBefore->getIterator(), this);
}
}
@@ -64,31 +64,32 @@ Module *Instruction::getModule() {
void Instruction::removeFromParent() {
- getParent()->getInstList().remove(this);
+ getParent()->getInstList().remove(getIterator());
}
iplist<Instruction>::iterator Instruction::eraseFromParent() {
- return getParent()->getInstList().erase(this);
+ return getParent()->getInstList().erase(getIterator());
}
/// insertBefore - Insert an unlinked instructions into a basic block
/// immediately before the specified instruction.
void Instruction::insertBefore(Instruction *InsertPos) {
- InsertPos->getParent()->getInstList().insert(InsertPos, this);
+ InsertPos->getParent()->getInstList().insert(InsertPos->getIterator(), this);
}
/// insertAfter - Insert an unlinked instructions into a basic block
/// immediately after the specified instruction.
void Instruction::insertAfter(Instruction *InsertPos) {
- InsertPos->getParent()->getInstList().insertAfter(InsertPos, this);
+ InsertPos->getParent()->getInstList().insertAfter(InsertPos->getIterator(),
+ this);
}
/// moveBefore - Unlink this instruction from its current basic block and
/// insert it into the basic block that MovePos lives in, right before
/// MovePos.
void Instruction::moveBefore(Instruction *MovePos) {
- MovePos->getParent()->getInstList().splice(MovePos,getParent()->getInstList(),
- this);
+ MovePos->getParent()->getInstList().splice(
+ MovePos->getIterator(), getParent()->getInstList(), getIterator());
}
/// Set or clear the unsafe-algebra flag on this instruction, which must be an
diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp
index 21dfb0912fc..2b9adad44ba 100644
--- a/llvm/lib/IR/Module.cpp
+++ b/llvm/lib/IR/Module.cpp
@@ -277,7 +277,7 @@ NamedMDNode *Module::getOrInsertNamedMetadata(StringRef Name) {
/// delete it.
void Module::eraseNamedMetadata(NamedMDNode *NMD) {
static_cast<StringMap<NamedMDNode *> *>(NamedMDSymTab)->erase(NMD->getName());
- NamedMDList.erase(NMD);
+ NamedMDList.erase(NMD->getIterator());
}
bool Module::isValidModFlagBehavior(Metadata *MD, ModFlagBehavior &MFB) {
diff --git a/llvm/lib/IR/SymbolTableListTraitsImpl.h b/llvm/lib/IR/SymbolTableListTraitsImpl.h
index e7fa8ba58f4..50573d8d688 100644
--- a/llvm/lib/IR/SymbolTableListTraitsImpl.h
+++ b/llvm/lib/IR/SymbolTableListTraitsImpl.h
@@ -55,7 +55,7 @@ void SymbolTableListTraits<ValueSubClass>::setSymTabObject(TPtr *Dest,
// Add all of the items to the new symtab.
for (auto I = ItemList.begin(); I != ItemList.end(); ++I)
if (I->hasName())
- NewST->reinsertValue(I);
+ NewST->reinsertValue(&*I);
}
}
diff --git a/llvm/lib/IR/TypeFinder.cpp b/llvm/lib/IR/TypeFinder.cpp
index 7accc5bef53..2ea0550ba45 100644
--- a/llvm/lib/IR/TypeFinder.cpp
+++ b/llvm/lib/IR/TypeFinder.cpp
@@ -56,7 +56,7 @@ void TypeFinder::run(const Module &M, bool onlyNamed) {
// First incorporate the arguments.
for (Function::const_arg_iterator AI = FI->arg_begin(),
AE = FI->arg_end(); AI != AE; ++AI)
- incorporateValue(AI);
+ incorporateValue(&*AI);
for (Function::const_iterator BB = FI->begin(), E = FI->end();
BB != E;++BB)
@@ -85,7 +85,7 @@ void TypeFinder::run(const Module &M, bool onlyNamed) {
for (Module::const_named_metadata_iterator I = M.named_metadata_begin(),
E = M.named_metadata_end(); I != E; ++I) {
- const NamedMDNode *NMD = I;
+ const NamedMDNode *NMD = &*I;
for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i)
incorporateMDNode(NMD->getOperand(i));
}
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 7b07bcea560..0207fe8150b 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -92,6 +92,10 @@ struct VerifierSupport {
: OS(OS), M(nullptr), Broken(false) {}
private:
+ template <class NodeTy> void Write(const ilist_iterator<NodeTy> &I) {
+ Write(&*I);
+ }
+
void Write(const Value *V) {
if (!V)
return;
OpenPOWER on IntegriCloud