[llvm-commits] CVS: llvm/lib/VMCore/Instructions.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri Jan 28 17:05:28 PST 2005
Changes in directory llvm/lib/VMCore:
Instructions.cpp updated: 1.9 -> 1.10
---
Log message:
Make sure that we always grow a multiple of 2 operands.
---
Diffs of the changes: (+3 -2)
Instructions.cpp | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
Index: llvm/lib/VMCore/Instructions.cpp
diff -u llvm/lib/VMCore/Instructions.cpp:1.9 llvm/lib/VMCore/Instructions.cpp:1.10
--- llvm/lib/VMCore/Instructions.cpp:1.9 Fri Jan 28 18:35:16 2005
+++ llvm/lib/VMCore/Instructions.cpp Fri Jan 28 19:05:12 2005
@@ -948,6 +948,7 @@
if (OpNo+2 > ReservedSpace)
resizeOperands(0); // Get more space!
// Initialize some new operands.
+ assert(OpNo+1 < ReservedSpace && "Growing didn't work!");
NumOperands = OpNo+2;
OperandList[OpNo].init(OnVal, this);
OperandList[OpNo+1].init(Dest, this);
@@ -989,14 +990,14 @@
///
void SwitchInst::resizeOperands(unsigned NumOps) {
if (NumOps == 0) {
- NumOps = (getNumOperands())*3/2;
+ NumOps = getNumOperands()/2*6;
} else if (NumOps*2 > NumOperands) {
// No resize needed.
if (ReservedSpace >= NumOps) return;
} else if (NumOps == NumOperands) {
if (ReservedSpace == NumOps) return;
} else {
- return;
+ return;
}
ReservedSpace = NumOps;
More information about the llvm-commits
mailing list