Don't create zero sized stack objects even for array allocas with a zero

number of elements.

llvm-svn: 23219
This commit is contained in:
Chris Lattner 2005-09-02 18:41:28 +00:00
parent 813a73e8e9
commit 365774f457

View File

@ -150,7 +150,8 @@ FunctionLoweringInfo::FunctionLoweringInfo(TargetLowering &tli,
// TargetData. It serves primarily to 8-byte align doubles for X86.
if (Align < TySize && TySize <= 8) Align = TySize;
TySize *= CUI->getValue(); // Get total allocated size.
if (CUI->getValue()) // Don't produce zero sized stack objects
TySize *= CUI->getValue(); // Get total allocated size.
StaticAllocaMap[AI] =
MF.getFrameInfo()->CreateStackObject((unsigned)TySize, Align);
}