mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
Pull assignment out of for loop conditional in order for this to
compile under windows. Patch contributed by Paolo Invernizzi! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16534 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1224,8 +1224,8 @@ void CWriter::printPHICopiesForSuccessors(BasicBlock *CurBlock,
|
|||||||
unsigned Indent) {
|
unsigned Indent) {
|
||||||
for (succ_iterator SI = succ_begin(CurBlock), E = succ_end(CurBlock);
|
for (succ_iterator SI = succ_begin(CurBlock), E = succ_end(CurBlock);
|
||||||
SI != E; ++SI)
|
SI != E; ++SI)
|
||||||
for (BasicBlock::iterator I = SI->begin();
|
for (BasicBlock::iterator I = SI->begin(); isa<PHINode>(I); ++I) {
|
||||||
PHINode *PN = dyn_cast<PHINode>(I); ++I) {
|
PHINode *PN = cast<PHINode>(I);
|
||||||
// now we have to do the printing
|
// now we have to do the printing
|
||||||
Out << std::string(Indent, ' ');
|
Out << std::string(Indent, ' ');
|
||||||
Out << " " << Mang->getValueName(I) << "__PHI_TEMPORARY = ";
|
Out << " " << Mang->getValueName(I) << "__PHI_TEMPORARY = ";
|
||||||
|
@ -1224,8 +1224,8 @@ void CWriter::printPHICopiesForSuccessors(BasicBlock *CurBlock,
|
|||||||
unsigned Indent) {
|
unsigned Indent) {
|
||||||
for (succ_iterator SI = succ_begin(CurBlock), E = succ_end(CurBlock);
|
for (succ_iterator SI = succ_begin(CurBlock), E = succ_end(CurBlock);
|
||||||
SI != E; ++SI)
|
SI != E; ++SI)
|
||||||
for (BasicBlock::iterator I = SI->begin();
|
for (BasicBlock::iterator I = SI->begin(); isa<PHINode>(I); ++I) {
|
||||||
PHINode *PN = dyn_cast<PHINode>(I); ++I) {
|
PHINode *PN = cast<PHINode>(I);
|
||||||
// now we have to do the printing
|
// now we have to do the printing
|
||||||
Out << std::string(Indent, ' ');
|
Out << std::string(Indent, ' ');
|
||||||
Out << " " << Mang->getValueName(I) << "__PHI_TEMPORARY = ";
|
Out << " " << Mang->getValueName(I) << "__PHI_TEMPORARY = ";
|
||||||
|
@ -213,8 +213,8 @@ BasicBlock *LoopSimplify::SplitBlockPredecessors(BasicBlock *BB,
|
|||||||
if (!Preds.empty()) { // Is the loop not obviously dead?
|
if (!Preds.empty()) { // Is the loop not obviously dead?
|
||||||
// Check to see if the values being merged into the new block need PHI
|
// Check to see if the values being merged into the new block need PHI
|
||||||
// nodes. If so, insert them.
|
// nodes. If so, insert them.
|
||||||
for (BasicBlock::iterator I = BB->begin();
|
for (BasicBlock::iterator I = BB->begin(); isa<PHINode>(I); ) {
|
||||||
PHINode *PN = dyn_cast<PHINode>(I); ) {
|
PHINode *PN = cast<PHINode>(I);
|
||||||
++I;
|
++I;
|
||||||
|
|
||||||
// Check to see if all of the values coming in are the same. If so, we
|
// Check to see if all of the values coming in are the same. If so, we
|
||||||
@ -266,10 +266,11 @@ BasicBlock *LoopSimplify::SplitBlockPredecessors(BasicBlock *BB,
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else { // Otherwise the loop is dead...
|
} else { // Otherwise the loop is dead...
|
||||||
for (BasicBlock::iterator I = BB->begin();
|
for (BasicBlock::iterator I = BB->begin(); isa<PHINode>(I); ++I) {
|
||||||
PHINode *PN = dyn_cast<PHINode>(I); ++I)
|
PHINode *PN = cast<PHINode>(I);
|
||||||
// Insert dummy values as the incoming value...
|
// Insert dummy values as the incoming value...
|
||||||
PN->addIncoming(Constant::getNullValue(PN->getType()), NewBB);
|
PN->addIncoming(Constant::getNullValue(PN->getType()), NewBB);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return NewBB;
|
return NewBB;
|
||||||
}
|
}
|
||||||
@ -426,8 +427,8 @@ static void AddBlockAndPredsToSet(BasicBlock *BB, BasicBlock *StopBlock,
|
|||||||
/// FindPHIToPartitionLoops - The first part of loop-nestification is to find a
|
/// FindPHIToPartitionLoops - The first part of loop-nestification is to find a
|
||||||
/// PHI node that tells us how to partition the loops.
|
/// PHI node that tells us how to partition the loops.
|
||||||
static PHINode *FindPHIToPartitionLoops(Loop *L) {
|
static PHINode *FindPHIToPartitionLoops(Loop *L) {
|
||||||
for (BasicBlock::iterator I = L->getHeader()->begin();
|
for (BasicBlock::iterator I = L->getHeader()->begin(); isa<PHINode>(I); ) {
|
||||||
PHINode *PN = dyn_cast<PHINode>(I); ) {
|
PHINode *PN = cast<PHINode>(I);
|
||||||
++I;
|
++I;
|
||||||
if (Value *V = hasConstantValue(PN)) {
|
if (Value *V = hasConstantValue(PN)) {
|
||||||
// This is a degenerate PHI already, don't modify it!
|
// This is a degenerate PHI already, don't modify it!
|
||||||
@ -565,8 +566,8 @@ void LoopSimplify::InsertUniqueBackedgeBlock(Loop *L) {
|
|||||||
|
|
||||||
// Now that the block has been inserted into the function, create PHI nodes in
|
// Now that the block has been inserted into the function, create PHI nodes in
|
||||||
// the backedge block which correspond to any PHI nodes in the header block.
|
// the backedge block which correspond to any PHI nodes in the header block.
|
||||||
for (BasicBlock::iterator I = Header->begin();
|
for (BasicBlock::iterator I = Header->begin(); isa<PHINode>(I); ++I) {
|
||||||
PHINode *PN = dyn_cast<PHINode>(I); ++I) {
|
PHINode *PN = cast<PHINode>(I);
|
||||||
PHINode *NewPN = new PHINode(PN->getType(), PN->getName()+".be",
|
PHINode *NewPN = new PHINode(PN->getType(), PN->getName()+".be",
|
||||||
BETerminator);
|
BETerminator);
|
||||||
NewPN->op_reserve(2*BackedgeBlocks.size());
|
NewPN->op_reserve(2*BackedgeBlocks.size());
|
||||||
|
Reference in New Issue
Block a user