llvm.org GIT mirror llvm / 1501cdb
Fix SmallVector's size calculation so that a size of 0 is handled correctly, and change a few SmallVector uses to use size 0 to more clearly reflect their intent. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55181 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 11 years ago
3 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
476476 // NumInlineEltsElts - The number of elements actually in this array. There
477477 // is already one in the parent class, and we have to round up to avoid
478478 // having a zero-element array.
479 NumInlineEltsElts = (MinUs - 1) > 0 ? (MinUs - 1) : 1,
479 NumInlineEltsElts = MinUs > 1 ? (MinUs - 1) : 1,
480480
481481 // NumTsAvailable - The number of T's we actually have space for, which may
482482 // be more than N due to rounding.
363363
364364 // If OldBB isn't immediately before OldBB, insert a branch to it.
365365 if (++MachineFunction::iterator(OldBB) != MachineFunction::iterator(NewDest))
366 TII->InsertBranch(*OldBB, NewDest, 0, SmallVector1>());
366 TII->InsertBranch(*OldBB, NewDest, 0, SmallVector0>());
367367 OldBB->addSuccessor(NewDest);
368368 ++NumTailMerge;
369369 }
443443 }
444444 }
445445 }
446 TII->InsertBranch(*CurMBB, SuccBB, NULL, SmallVector1>());
446 TII->InsertBranch(*CurMBB, SuccBB, NULL, SmallVector0>());
447447 }
448448
449449 static bool MergeCompare(const std::pair &p,
814814 ///
815815 static void InsertUncondBranch(MachineBasicBlock *BB, MachineBasicBlock *ToBB,
816816 const TargetInstrInfo *TII) {
817 SmallVector1> NoCond;
817 SmallVector0> NoCond;
818818 TII->InsertBranch(*BB, ToBB, NULL, NoCond);
819819 }
820820