aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-08-22 16:07:55 +0000
committerDan Gohman <gohman@apple.com>2008-08-22 16:07:55 +0000
commite458ea810c21132ec659af98842d5dae560bf8b8 (patch)
tree4bd8c7134277e2a860214aa80bb833260a8337b7 /lib/CodeGen
parent1345675e363ebcc1a752e945de8dc93d61a9e730 (diff)
downloadexternal_llvm-e458ea810c21132ec659af98842d5dae560bf8b8.zip
external_llvm-e458ea810c21132ec659af98842d5dae560bf8b8.tar.gz
external_llvm-e458ea810c21132ec659af98842d5dae560bf8b8.tar.bz2
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
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/BranchFolding.cpp4
-rw-r--r--lib/CodeGen/IfConversion.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp
index c97f176..2ccfd19 100644
--- a/lib/CodeGen/BranchFolding.cpp
+++ b/lib/CodeGen/BranchFolding.cpp
@@ -364,7 +364,7 @@ void BranchFolder::ReplaceTailWithBranchTo(MachineBasicBlock::iterator OldInst,
// If OldBB isn't immediately before OldBB, insert a branch to it.
if (++MachineFunction::iterator(OldBB) != MachineFunction::iterator(NewDest))
- TII->InsertBranch(*OldBB, NewDest, 0, SmallVector<MachineOperand, 1>());
+ TII->InsertBranch(*OldBB, NewDest, 0, SmallVector<MachineOperand, 0>());
OldBB->addSuccessor(NewDest);
++NumTailMerge;
}
@@ -444,7 +444,7 @@ static void FixTail(MachineBasicBlock* CurMBB, MachineBasicBlock *SuccBB,
}
}
}
- TII->InsertBranch(*CurMBB, SuccBB, NULL, SmallVector<MachineOperand, 1>());
+ TII->InsertBranch(*CurMBB, SuccBB, NULL, SmallVector<MachineOperand, 0>());
}
static bool MergeCompare(const std::pair<unsigned,MachineBasicBlock*> &p,
diff --git a/lib/CodeGen/IfConversion.cpp b/lib/CodeGen/IfConversion.cpp
index d98b0ce..079b701 100644
--- a/lib/CodeGen/IfConversion.cpp
+++ b/lib/CodeGen/IfConversion.cpp
@@ -815,7 +815,7 @@ void IfConverter::InvalidatePreds(MachineBasicBlock *BB) {
///
static void InsertUncondBranch(MachineBasicBlock *BB, MachineBasicBlock *ToBB,
const TargetInstrInfo *TII) {
- SmallVector<MachineOperand, 1> NoCond;
+ SmallVector<MachineOperand, 0> NoCond;
TII->InsertBranch(*BB, ToBB, NULL, NoCond);
}