[llvm] r280565 - ADT: Remove external uses of ilist_iterator, NFC
Duncan P. N. Exon Smith via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 2 18:22:56 PDT 2016
Author: dexonsmith
Date: Fri Sep 2 20:22:56 2016
New Revision: 280565
URL: http://llvm.org/viewvc/llvm-project?rev=280565&view=rev
Log:
ADT: Remove external uses of ilist_iterator, NFC
Delete the dead code for Write(ilist_iterator) in the IR Verifier,
inline report(ilist_iterator) at its call sites in the MachineVerifier,
and use simple_ilist<>::iterator in SymbolTableListTraits.
The only remaining reference to ilist_iterator outside of the ilist
implementation is from MachineInstrBundleIterator. I'll get rid of that
in a follow-up.
Modified:
llvm/trunk/include/llvm/IR/SymbolTableListTraits.h
llvm/trunk/lib/CodeGen/MachineVerifier.cpp
llvm/trunk/lib/IR/SymbolTableListTraitsImpl.h
llvm/trunk/lib/IR/Verifier.cpp
Modified: llvm/trunk/include/llvm/IR/SymbolTableListTraits.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/SymbolTableListTraits.h?rev=280565&r1=280564&r2=280565&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/SymbolTableListTraits.h (original)
+++ llvm/trunk/include/llvm/IR/SymbolTableListTraits.h Fri Sep 2 20:22:56 2016
@@ -62,7 +62,7 @@ template <typename NodeTy> class SymbolT
template <typename ValueSubClass>
class SymbolTableListTraits : public ilist_alloc_traits<ValueSubClass> {
typedef SymbolTableList<ValueSubClass> ListTy;
- typedef ilist_iterator<ValueSubClass, false> iterator;
+ typedef typename simple_ilist<ValueSubClass>::iterator iterator;
typedef
typename SymbolTableListParentType<ValueSubClass>::type ItemParentClass;
Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineVerifier.cpp?rev=280565&r1=280564&r2=280565&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Fri Sep 2 20:22:56 2016
@@ -208,9 +208,6 @@ namespace {
void visitMachineBasicBlockAfter(const MachineBasicBlock *MBB);
void visitMachineFunctionAfter();
- template <typename T> void report(const char *msg, ilist_iterator<T> I) {
- report(msg, &*I);
- }
void report(const char *msg, const MachineFunction *MF);
void report(const char *msg, const MachineBasicBlock *MBB);
void report(const char *msg, const MachineInstr *MI);
@@ -365,7 +362,7 @@ unsigned MachineVerifier::verify(Machine
for (MachineBasicBlock::const_instr_iterator MBBI = MFI->instr_begin(),
MBBE = MFI->instr_end(); MBBI != MBBE; ++MBBI) {
if (MBBI->getParent() != &*MFI) {
- report("Bad instruction parent pointer", MFI);
+ report("Bad instruction parent pointer", &*MFI);
errs() << "Instruction: " << *MBBI;
continue;
}
@@ -387,7 +384,7 @@ unsigned MachineVerifier::verify(Machine
CurBundle = &*MBBI;
visitMachineBundleBefore(CurBundle);
} else if (!CurBundle)
- report("No bundle header", MBBI);
+ report("No bundle header", &*MBBI);
visitMachineInstrBefore(&*MBBI);
for (unsigned I = 0, E = MBBI->getNumOperands(); I != E; ++I) {
const MachineInstr &MI = *MBBI;
Modified: llvm/trunk/lib/IR/SymbolTableListTraitsImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/SymbolTableListTraitsImpl.h?rev=280565&r1=280564&r2=280565&view=diff
==============================================================================
--- llvm/trunk/lib/IR/SymbolTableListTraitsImpl.h (original)
+++ llvm/trunk/lib/IR/SymbolTableListTraitsImpl.h Fri Sep 2 20:22:56 2016
@@ -81,8 +81,7 @@ void SymbolTableListTraits<ValueSubClass
template <typename ValueSubClass>
void SymbolTableListTraits<ValueSubClass>::transferNodesFromList(
- SymbolTableListTraits &L2, ilist_iterator<ValueSubClass> first,
- ilist_iterator<ValueSubClass> last) {
+ SymbolTableListTraits &L2, iterator first, iterator last) {
// We only have to do work here if transferring instructions between BBs
ItemParentClass *NewIP = getListOwner(), *OldIP = L2.getListOwner();
assert(NewIP != OldIP && "Expected different list owners");
Modified: llvm/trunk/lib/IR/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Verifier.cpp?rev=280565&r1=280564&r2=280565&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Verifier.cpp (original)
+++ llvm/trunk/lib/IR/Verifier.cpp Fri Sep 2 20:22:56 2016
@@ -137,10 +137,6 @@ struct VerifierSupport {
: OS(OS), M(M), MST(&M), DL(M.getDataLayout()), Context(M.getContext()) {}
private:
- template <class NodeTy> void Write(const ilist_iterator<NodeTy> &I) {
- Write(&*I);
- }
-
void Write(const Module *M) {
*OS << "; ModuleID = '" << M->getModuleIdentifier() << "'\n";
}
More information about the llvm-commits
mailing list