aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprConstant.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-12-08 21:12:32 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-12-08 21:12:32 +0000
commit88b172cd206aa94f8eab071787f4a7ec2442c407 (patch)
tree1e6ca1d41afe36743ec0de07779b37f4bcdf11ec /lib/CodeGen/CGExprConstant.cpp
parent2b48ed7e172e2a2a6535a0bc89cf40f6de9ec2ef (diff)
Update CGExprConstant for change to emit padding values as undef.
- This fixes 2003-05-21-BitfieldHandling. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90876 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
-rw-r--r--lib/CodeGen/CGExprConstant.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp
index 9289f78d55..d428983f01 100644
--- a/lib/CodeGen/CGExprConstant.cpp
+++ b/lib/CodeGen/CGExprConstant.cpp
@@ -167,7 +167,11 @@ class ConstStructBuilder {
}
// Or in the bits that go into the previous byte.
- Tmp |= cast<llvm::ConstantInt>(Elements.back())->getValue();
+ if (llvm::ConstantInt *Val = dyn_cast<llvm::ConstantInt>(Elements.back()))
+ Tmp |= Val->getValue();
+ else
+ assert(isa<llvm::UndefValue>(Elements.back()));
+
Elements.back() = llvm::ConstantInt::get(CGM.getLLVMContext(), Tmp);
if (FitsCompletelyInPreviousByte)