diff options
author | Chris Lattner <sabre@nondot.org> | 2007-06-04 22:23:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-06-04 22:23:42 +0000 |
commit | f0a9aaba4c61388678494c17c690f93b7eff270c (patch) | |
tree | 1aeb02bd11b842be6a35523ba15a7003b2300b0f /lib/Transforms | |
parent | f3bee467924967357ef6652404a8ed694d9e051c (diff) |
When rebuilding constant structs, make sure to honor the isPacked bit.
This fixes PR1491 and GlobalOpt/2007-06-04-PackedStruct.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37423 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/IPO/GlobalOpt.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 516ba4363e..520af8750e 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -1625,7 +1625,7 @@ static Constant *EvaluateStoreInto(Constant *Init, Constant *Val, Elts[Idx] = EvaluateStoreInto(Elts[Idx], Val, Addr, OpNo+1); // Return the modified struct. - return ConstantStruct::get(Elts); + return ConstantStruct::get(&Elts[0], Elts.size(), STy->isPacked()); } else { ConstantInt *CI = cast<ConstantInt>(Addr->getOperand(OpNo)); const ArrayType *ATy = cast<ArrayType>(Init->getType()); |