Fix warning
llvm-svn: 4649
diff --git a/llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp b/llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp
index b0c15f7..bc815c6 100644
--- a/llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp
+++ b/llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp
@@ -87,7 +87,7 @@
std::vector<Edge> edges;
Node *tmp;
- Node *exitNode, *startNode;
+ Node *exitNode = 0, *startNode = 0;
// The nodes must be uniquesly identified:
// That is, no two nodes must hav same BB*
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index e540310..f57d8b1 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -724,13 +724,15 @@
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...