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 | 0006bd75201f340b95c1dbf71e50dc5de5ed9425 (patch) | |
tree | b92a619dde2fc0aec7a6209ea840eeaa50a525d4 /lib/Transforms | |
parent | bf10f05bf731b00979bb38f9c0c3d7a1145d8859 (diff) | |
download | external_llvm-0006bd75201f340b95c1dbf71e50dc5de5ed9425.zip external_llvm-0006bd75201f340b95c1dbf71e50dc5de5ed9425.tar.gz external_llvm-0006bd75201f340b95c1dbf71e50dc5de5ed9425.tar.bz2 |
Fix warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4649 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp b/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp index b0c15f7..bc815c6 100644 --- a/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp +++ b/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp @@ -87,7 +87,7 @@ bool ProfilePaths::runOnFunction(Function &F){ 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/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index e540310..f57d8b1 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/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... |