mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-04 18:24:38 +00:00
Use range for loops in PlaceSafepoints (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228620 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -297,8 +297,7 @@ static void scanOneBB(Instruction *start, Instruction *end,
|
|||||||
// without encountering end first
|
// without encountering end first
|
||||||
if (itr->isTerminator()) {
|
if (itr->isTerminator()) {
|
||||||
BasicBlock *BB = itr->getParent();
|
BasicBlock *BB = itr->getParent();
|
||||||
for (succ_iterator PI = succ_begin(BB), E = succ_end(BB); PI != E; ++PI) {
|
for (BasicBlock *Succ : successors(BB)) {
|
||||||
BasicBlock *Succ = *PI;
|
|
||||||
if (seen.count(Succ) == 0) {
|
if (seen.count(Succ) == 0) {
|
||||||
worklist.push_back(Succ);
|
worklist.push_back(Succ);
|
||||||
seen.insert(Succ);
|
seen.insert(Succ);
|
||||||
@ -336,9 +335,7 @@ bool PlaceBackedgeSafepointsImpl::runOnLoop(Loop *L, LPPassManager &LPM) {
|
|||||||
DT.recalculate(*header->getParent());
|
DT.recalculate(*header->getParent());
|
||||||
|
|
||||||
bool modified = false;
|
bool modified = false;
|
||||||
for (pred_iterator PI = pred_begin(header), E = pred_end(header); PI != E;
|
for (BasicBlock *pred : predecessors(header)) {
|
||||||
PI++) {
|
|
||||||
BasicBlock *pred = *PI;
|
|
||||||
if (!L->contains(pred)) {
|
if (!L->contains(pred)) {
|
||||||
// This is not a backedge, it's coming from outside the loop
|
// This is not a backedge, it's coming from outside the loop
|
||||||
continue;
|
continue;
|
||||||
@ -470,9 +467,8 @@ static Instruction *findLocationForEntrySafepoint(Function &F,
|
|||||||
static void findCallSafepoints(Function &F,
|
static void findCallSafepoints(Function &F,
|
||||||
std::vector<CallSite> &Found /*rval*/) {
|
std::vector<CallSite> &Found /*rval*/) {
|
||||||
assert(Found.empty() && "must be empty!");
|
assert(Found.empty() && "must be empty!");
|
||||||
for (inst_iterator itr = inst_begin(F), end = inst_end(F); itr != end;
|
for (Instruction &I : inst_range(F)) {
|
||||||
itr++) {
|
Instruction *inst = &I;
|
||||||
Instruction *inst = &*itr;
|
|
||||||
if (isa<CallInst>(inst) || isa<InvokeInst>(inst)) {
|
if (isa<CallInst>(inst) || isa<InvokeInst>(inst)) {
|
||||||
CallSite CS(inst);
|
CallSite CS(inst);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user