[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri Jul 2 20:19:15 PDT 2004
Changes in directory llvm/lib/Transforms/Scalar:
InstructionCombining.cpp updated: 1.215 -> 1.216
---
Log message:
Do not call getTypeSize on a type that has no size
---
Diffs of the changes: (+2 -1)
Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.215 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.216
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.215 Sun Jun 27 17:51:36 2004
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Fri Jul 2 17:55:47 2004
@@ -2854,7 +2854,8 @@
// If alloca'ing a zero byte object, replace the alloca with a null pointer.
// Note that we only do this for alloca's, because malloc should allocate and
// return a unique pointer, even for a zero byte allocation.
- if (isa<AllocaInst>(AI) && TD->getTypeSize(AI.getAllocatedType()) == 0)
+ if (isa<AllocaInst>(AI) && AI.getAllocatedType()->isSized() &&
+ TD->getTypeSize(AI.getAllocatedType()) == 0)
return ReplaceInstUsesWith(AI, Constant::getNullValue(AI.getType()));
return 0;
More information about the llvm-commits
mailing list