mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-16 11:30:51 +00:00
remove use of getPrev() and getNext() on ilist nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20673 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
41b162faba
commit
67c2d18166
@ -33,6 +33,7 @@
|
|||||||
#include "llvm/Support/InstVisitor.h"
|
#include "llvm/Support/InstVisitor.h"
|
||||||
#include "llvm/Support/Mangler.h"
|
#include "llvm/Support/Mangler.h"
|
||||||
#include "llvm/ADT/StringExtras.h"
|
#include "llvm/ADT/StringExtras.h"
|
||||||
|
#include "llvm/ADT/STLExtras.h"
|
||||||
#include "llvm/Support/MathExtras.h"
|
#include "llvm/Support/MathExtras.h"
|
||||||
#include "llvm/Config/config.h"
|
#include "llvm/Config/config.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -1246,7 +1247,7 @@ void CWriter::visitSwitchInst(SwitchInst &SI) {
|
|||||||
BasicBlock *Succ = cast<BasicBlock>(SI.getOperand(i+1));
|
BasicBlock *Succ = cast<BasicBlock>(SI.getOperand(i+1));
|
||||||
printPHICopiesForSuccessor (SI.getParent(), Succ, 2);
|
printPHICopiesForSuccessor (SI.getParent(), Succ, 2);
|
||||||
printBranchToBlock(SI.getParent(), Succ, 2);
|
printBranchToBlock(SI.getParent(), Succ, 2);
|
||||||
if (Succ == SI.getParent()->getNext())
|
if (Succ == next(Function::iterator(SI.getParent())))
|
||||||
Out << " break;\n";
|
Out << " break;\n";
|
||||||
}
|
}
|
||||||
Out << " }\n";
|
Out << " }\n";
|
||||||
@ -1260,12 +1261,11 @@ bool CWriter::isGotoCodeNecessary(BasicBlock *From, BasicBlock *To) {
|
|||||||
/// FIXME: This should be reenabled, but loop reordering safe!!
|
/// FIXME: This should be reenabled, but loop reordering safe!!
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (From->getNext() != To) // Not the direct successor, we need a goto
|
if (next(Function::iterator(From)) != Function::iterator(To))
|
||||||
return true;
|
return true; // Not the direct successor, we need a goto.
|
||||||
|
|
||||||
//isa<SwitchInst>(From->getTerminator())
|
//isa<SwitchInst>(From->getTerminator())
|
||||||
|
|
||||||
|
|
||||||
if (LI->getLoopFor(From) != LI->getLoopFor(To))
|
if (LI->getLoopFor(From) != LI->getLoopFor(To))
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@ -1443,7 +1443,10 @@ void CWriter::lowerIntrinsics(Function &F) {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// All other intrinsic calls we must lower.
|
// All other intrinsic calls we must lower.
|
||||||
Instruction *Before = CI->getPrev();
|
Instruction *Before = 0;
|
||||||
|
if (CI != &BB->front())
|
||||||
|
Before = prior(BasicBlock::iterator(CI));
|
||||||
|
|
||||||
IL.LowerIntrinsicCall(CI);
|
IL.LowerIntrinsicCall(CI);
|
||||||
if (Before) { // Move iterator to instruction after call
|
if (Before) { // Move iterator to instruction after call
|
||||||
I = Before; ++I;
|
I = Before; ++I;
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "llvm/Support/InstVisitor.h"
|
#include "llvm/Support/InstVisitor.h"
|
||||||
#include "llvm/Support/Mangler.h"
|
#include "llvm/Support/Mangler.h"
|
||||||
#include "llvm/ADT/StringExtras.h"
|
#include "llvm/ADT/StringExtras.h"
|
||||||
|
#include "llvm/ADT/STLExtras.h"
|
||||||
#include "llvm/Support/MathExtras.h"
|
#include "llvm/Support/MathExtras.h"
|
||||||
#include "llvm/Config/config.h"
|
#include "llvm/Config/config.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -1246,7 +1247,7 @@ void CWriter::visitSwitchInst(SwitchInst &SI) {
|
|||||||
BasicBlock *Succ = cast<BasicBlock>(SI.getOperand(i+1));
|
BasicBlock *Succ = cast<BasicBlock>(SI.getOperand(i+1));
|
||||||
printPHICopiesForSuccessor (SI.getParent(), Succ, 2);
|
printPHICopiesForSuccessor (SI.getParent(), Succ, 2);
|
||||||
printBranchToBlock(SI.getParent(), Succ, 2);
|
printBranchToBlock(SI.getParent(), Succ, 2);
|
||||||
if (Succ == SI.getParent()->getNext())
|
if (Succ == next(Function::iterator(SI.getParent())))
|
||||||
Out << " break;\n";
|
Out << " break;\n";
|
||||||
}
|
}
|
||||||
Out << " }\n";
|
Out << " }\n";
|
||||||
@ -1260,12 +1261,11 @@ bool CWriter::isGotoCodeNecessary(BasicBlock *From, BasicBlock *To) {
|
|||||||
/// FIXME: This should be reenabled, but loop reordering safe!!
|
/// FIXME: This should be reenabled, but loop reordering safe!!
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (From->getNext() != To) // Not the direct successor, we need a goto
|
if (next(Function::iterator(From)) != Function::iterator(To))
|
||||||
return true;
|
return true; // Not the direct successor, we need a goto.
|
||||||
|
|
||||||
//isa<SwitchInst>(From->getTerminator())
|
//isa<SwitchInst>(From->getTerminator())
|
||||||
|
|
||||||
|
|
||||||
if (LI->getLoopFor(From) != LI->getLoopFor(To))
|
if (LI->getLoopFor(From) != LI->getLoopFor(To))
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@ -1443,7 +1443,10 @@ void CWriter::lowerIntrinsics(Function &F) {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// All other intrinsic calls we must lower.
|
// All other intrinsic calls we must lower.
|
||||||
Instruction *Before = CI->getPrev();
|
Instruction *Before = 0;
|
||||||
|
if (CI != &BB->front())
|
||||||
|
Before = prior(BasicBlock::iterator(CI));
|
||||||
|
|
||||||
IL.LowerIntrinsicCall(CI);
|
IL.LowerIntrinsicCall(CI);
|
||||||
if (Before) { // Move iterator to instruction after call
|
if (Before) { // Move iterator to instruction after call
|
||||||
I = Before; ++I;
|
I = Before; ++I;
|
||||||
|
Loading…
Reference in New Issue
Block a user