diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-11-09 00:49:43 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-11-09 00:49:43 +0000 |
| commit | a2620ac1568a788a122ecfd5c03d136e92dd38fe (patch) | |
| tree | 895ee544d9cd691e289cc54898265bf736600c8b /llvm/lib/Transforms/Scalar | |
| parent | 63aeefeafba129ae4cbc3cc3bf007a064b978e06 (diff) | |
| download | bcm5719-llvm-a2620ac1568a788a122ecfd5c03d136e92dd38fe.tar.gz bcm5719-llvm-a2620ac1568a788a122ecfd5c03d136e92dd38fe.zip | |
Fix warning
llvm-svn: 4649
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index e540310f6b3..f57d8b1c36b 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -724,13 +724,15 @@ Instruction *InstCombiner::visitAllocationInst(AllocationInst &AI) { if (AI.isArrayAllocation()) // Check C != 1 if (const ConstantUInt *C = dyn_cast<ConstantUInt>(AI.getArraySize())) { const Type *NewTy = ArrayType::get(AI.getAllocatedType(), C->getValue()); - AllocationInst *New; + AllocationInst *New = 0; // Create and insert the replacement instruction... if (isa<MallocInst>(AI)) New = new MallocInst(NewTy, 0, AI.getName(), &AI); - else if (isa<AllocaInst>(AI)) + else { + assert(isa<AllocaInst>(AI) && "Unknown type of allocation inst!"); New = new AllocaInst(NewTy, 0, AI.getName(), &AI); + } // Scan to the end of the allocation instructions, to skip over a block of // allocas if possible... |

