Avoid redefinition and nnbreak windows build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55911 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2008-09-08 16:01:27 +00:00
parent d4fde0b11c
commit 9f1185076d

View File

@ -718,7 +718,7 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF) {
BasicBlock::iterator const Begin = LLVMBB->begin(); BasicBlock::iterator const Begin = LLVMBB->begin();
BasicBlock::iterator const End = LLVMBB->end(); BasicBlock::iterator const End = LLVMBB->end();
BasicBlock::iterator I = Begin; BasicBlock::iterator BI = Begin;
// Lower any arguments needed in this block if this is the entry block. // Lower any arguments needed in this block if this is the entry block.
if (LLVMBB == &Fn.getEntryBlock()) if (LLVMBB == &Fn.getEntryBlock())
@ -738,7 +738,7 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF) {
} }
F->setCurrentBlock(BB); F->setCurrentBlock(BB);
// Do FastISel on as many instructions as possible. // Do FastISel on as many instructions as possible.
for (; I != End; ++I) { for (; BI != End; ++BI) {
// Just before the terminator instruction, insert instructions to // Just before the terminator instruction, insert instructions to
// feed PHI nodes in successor blocks. // feed PHI nodes in successor blocks.
if (isa<TerminatorInst>(I)) if (isa<TerminatorInst>(I))
@ -746,41 +746,41 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF) {
if (DisableFastISelAbort) if (DisableFastISelAbort)
break; break;
#ifndef NDEBUG #ifndef NDEBUG
I->dump(); BI->dump();
#endif #endif
assert(0 && "FastISel didn't handle a PHI in a successor"); assert(0 && "FastISel didn't handle a PHI in a successor");
} }
// First try normal tablegen-generated "fast" selection. // First try normal tablegen-generated "fast" selection.
if (F->SelectInstruction(I)) if (F->SelectInstruction(BI))
continue; continue;
// Next, try calling the target to attempt to handle the instruction. // Next, try calling the target to attempt to handle the instruction.
if (F->TargetSelectInstruction(I)) if (F->TargetSelectInstruction(BI))
continue; continue;
// Then handle certain instructions as single-LLVM-Instruction blocks. // Then handle certain instructions as single-LLVM-Instruction blocks.
if (isa<CallInst>(I) || isa<LoadInst>(I) || if (isa<CallInst>(BI) || isa<LoadInst>(BI) ||
isa<StoreInst>(I)) { isa<StoreInst>(BI)) {
if (I->getType() != Type::VoidTy) { if (BI->getType() != Type::VoidTy) {
unsigned &R = FuncInfo->ValueMap[I]; unsigned &R = FuncInfo->ValueMap[I];
if (!R) if (!R)
R = FuncInfo->CreateRegForValue(I); R = FuncInfo->CreateRegForValue(BI);
} }
SelectBasicBlock(LLVMBB, I, next(I)); SelectBasicBlock(LLVMBB, BI, next(BI));
continue; continue;
} }
if (!DisableFastISelAbort && if (!DisableFastISelAbort &&
// For now, don't abort on non-conditional-branch terminators. // For now, don't abort on non-conditional-branch terminators.
(!isa<TerminatorInst>(I) || (!isa<TerminatorInst>(BI) ||
(isa<BranchInst>(I) && (isa<BranchInst>(BI) &&
cast<BranchInst>(I)->isUnconditional()))) { cast<BranchInst>(BI)->isUnconditional()))) {
// The "fast" selector couldn't handle something and bailed. // The "fast" selector couldn't handle something and bailed.
// For the purpose of debugging, just abort. // For the purpose of debugging, just abort.
#ifndef NDEBUG #ifndef NDEBUG
I->dump(); BI->dump();
#endif #endif
assert(0 && "FastISel didn't select the entire block"); assert(0 && "FastISel didn't select the entire block");
} }
@ -793,8 +793,8 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF) {
// Run SelectionDAG instruction selection on the remainder of the block // Run SelectionDAG instruction selection on the remainder of the block
// not handled by FastISel. If FastISel is not run, this is the entire // not handled by FastISel. If FastISel is not run, this is the entire
// block. // block.
if (I != End) if (BI != End)
SelectBasicBlock(LLVMBB, I, End); SelectBasicBlock(LLVMBB, BI, End);
FinishBasicBlock(); FinishBasicBlock();
} }