summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/BlockFrequencyInfo.cpp6
-rw-r--r--llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp6
-rw-r--r--llvm/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp8
-rw-r--r--llvm/lib/Transforms/Scalar/NaryReassociate.cpp2
-rw-r--r--llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp2
-rw-r--r--llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp2
6 files changed, 13 insertions, 13 deletions
diff --git a/llvm/lib/Analysis/BlockFrequencyInfo.cpp b/llvm/lib/Analysis/BlockFrequencyInfo.cpp
index 600f945a8b2..a20c8fb280d 100644
--- a/llvm/lib/Analysis/BlockFrequencyInfo.cpp
+++ b/llvm/lib/Analysis/BlockFrequencyInfo.cpp
@@ -63,7 +63,7 @@ struct GraphTraits<BlockFrequencyInfo *> {
typedef const BasicBlock NodeType;
typedef const BasicBlock *NodeRef;
typedef succ_const_iterator ChildIteratorType;
- typedef Function::const_iterator nodes_iterator;
+ typedef pointer_iterator<Function::const_iterator> nodes_iterator;
static inline const NodeType *getEntryNode(const BlockFrequencyInfo *G) {
return &G->getFunction()->front();
@@ -75,10 +75,10 @@ struct GraphTraits<BlockFrequencyInfo *> {
return succ_end(N);
}
static nodes_iterator nodes_begin(const BlockFrequencyInfo *G) {
- return G->getFunction()->begin();
+ return nodes_iterator(G->getFunction()->begin());
}
static nodes_iterator nodes_end(const BlockFrequencyInfo *G) {
- return G->getFunction()->end();
+ return nodes_iterator(G->getFunction()->end());
}
};
diff --git a/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp b/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp
index 22d47fe1443..4147e5e1bb6 100644
--- a/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp
+++ b/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp
@@ -55,7 +55,7 @@ template <> struct GraphTraits<MachineBlockFrequencyInfo *> {
typedef const MachineBasicBlock NodeType;
typedef const MachineBasicBlock *NodeRef;
typedef MachineBasicBlock::const_succ_iterator ChildIteratorType;
- typedef MachineFunction::const_iterator nodes_iterator;
+ typedef pointer_iterator<MachineFunction::const_iterator> nodes_iterator;
static inline const NodeType *
getEntryNode(const MachineBlockFrequencyInfo *G) {
@@ -71,11 +71,11 @@ template <> struct GraphTraits<MachineBlockFrequencyInfo *> {
}
static nodes_iterator nodes_begin(const MachineBlockFrequencyInfo *G) {
- return G->getFunction()->begin();
+ return nodes_iterator(G->getFunction()->begin());
}
static nodes_iterator nodes_end(const MachineBlockFrequencyInfo *G) {
- return G->getFunction()->end();
+ return nodes_iterator(G->getFunction()->end());
}
};
diff --git a/llvm/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp b/llvm/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp
index 5ad80f65ac1..64dcb4558aa 100644
--- a/llvm/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp
@@ -840,7 +840,7 @@ bool AMDGPUCFGStructurizer::run() {
} //while, "one iteration" over the function.
MachineBasicBlock *EntryMBB =
- &*GraphTraits<MachineFunction *>::nodes_begin(FuncRep);
+ *GraphTraits<MachineFunction *>::nodes_begin(FuncRep);
if (EntryMBB->succ_size() == 0) {
Finish = true;
DEBUG(
@@ -863,7 +863,7 @@ bool AMDGPUCFGStructurizer::run() {
} while (!Finish && MakeProgress);
// Misc wrap up to maintain the consistency of the Function representation.
- wrapup(&*GraphTraits<MachineFunction *>::nodes_begin(FuncRep));
+ wrapup(*GraphTraits<MachineFunction *>::nodes_begin(FuncRep));
// Detach retired Block, release memory.
for (MBBInfoMap::iterator It = BlockInfoMap.begin(), E = BlockInfoMap.end();
@@ -907,9 +907,9 @@ void AMDGPUCFGStructurizer::orderBlocks(MachineFunction *MF) {
//walk through all the block in func to check for unreachable
typedef GraphTraits<MachineFunction *> GTM;
- MachineFunction::iterator It = GTM::nodes_begin(MF), E = GTM::nodes_end(MF);
+ auto It = GTM::nodes_begin(MF), E = GTM::nodes_end(MF);
for (; It != E; ++It) {
- MachineBasicBlock *MBB = &(*It);
+ MachineBasicBlock *MBB = *It;
SccNum = getSCCNum(MBB);
if (SccNum == INVALIDSCCNUM)
dbgs() << "unreachable block BB" << MBB->getNumber() << "\n";
diff --git a/llvm/lib/Transforms/Scalar/NaryReassociate.cpp b/llvm/lib/Transforms/Scalar/NaryReassociate.cpp
index 84ccb507a90..5bde45f1779 100644
--- a/llvm/lib/Transforms/Scalar/NaryReassociate.cpp
+++ b/llvm/lib/Transforms/Scalar/NaryReassociate.cpp
@@ -211,7 +211,7 @@ bool NaryReassociatePass::doOneIteration(Function &F) {
// ensures that all bases of a candidate are in Candidates when we process it.
for (auto Node = GraphTraits<DominatorTree *>::nodes_begin(DT);
Node != GraphTraits<DominatorTree *>::nodes_end(DT); ++Node) {
- BasicBlock *BB = Node->getBlock();
+ BasicBlock *BB = (*Node)->getBlock();
for (auto I = BB->begin(); I != BB->end(); ++I) {
if (SE->isSCEVable(I->getType()) && isPotentiallyNaryReassociable(&*I)) {
const SCEV *OldSCEV = SE->getSCEV(&*I);
diff --git a/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp b/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
index d6ae186698c..e0180fb8a03 100644
--- a/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
+++ b/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
@@ -1152,7 +1152,7 @@ bool SeparateConstOffsetFromGEP::reuniteExts(Function &F) {
DominatingExprs.clear();
for (auto Node = GraphTraits<DominatorTree *>::nodes_begin(DT);
Node != GraphTraits<DominatorTree *>::nodes_end(DT); ++Node) {
- BasicBlock *BB = Node->getBlock();
+ BasicBlock *BB = (*Node)->getBlock();
for (auto I = BB->begin(); I != BB->end(); ) {
Instruction *Cur = &*I++;
Changed |= reuniteExts(Cur);
diff --git a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
index 292d0400a51..a4da5fe2335 100644
--- a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
@@ -676,7 +676,7 @@ bool StraightLineStrengthReduce::runOnFunction(Function &F) {
// all bases of a candidate are in Candidates when we process it.
for (auto node = GraphTraits<DominatorTree *>::nodes_begin(DT);
node != GraphTraits<DominatorTree *>::nodes_end(DT); ++node) {
- for (auto &I : *node->getBlock())
+ for (auto &I : *(*node)->getBlock())
allocateCandidatesAndFindBasis(&I);
}
OpenPOWER on IntegriCloud