summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprConstant.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-12 21:10:05 +0000
committerChris Lattner <sabre@nondot.org>2010-04-12 21:10:05 +0000
commit933f67887fcce41e73655b33da237e6bc61a46ea (patch)
tree0654db4d1b2d157c5bf6d96da2eb2263011b6b02 /clang/lib/CodeGen/CGExprConstant.cpp
parentf9c24f840393b275908661d575c07d307ad44d1c (diff)
downloadbcm5719-llvm-933f67887fcce41e73655b33da237e6bc61a46ea.tar.gz
bcm5719-llvm-933f67887fcce41e73655b33da237e6bc61a46ea.zip
fix PR6660/6168: emit padding as zeros instead of undef. Because
trailing fields may not be represented in initializer lists, they are being handled as padding and those fields *must* be zero initialized. llvm-svn: 101067
Diffstat (limited to 'clang/lib/CodeGen/CGExprConstant.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprConstant.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp
index 172a77d78e5..c57cf5b7b62 100644
--- a/clang/lib/CodeGen/CGExprConstant.cpp
+++ b/clang/lib/CodeGen/CGExprConstant.cpp
@@ -231,7 +231,7 @@ class ConstStructBuilder {
if (NumBytes > 1)
Ty = llvm::ArrayType::get(Ty, NumBytes);
- llvm::Constant *C = llvm::UndefValue::get(Ty);
+ llvm::Constant *C = llvm::Constant::getNullValue(Ty);
Elements.push_back(C);
assert(getAlignment(C) == 1 && "Padding must have 1 byte alignment!");
@@ -269,7 +269,7 @@ class ConstStructBuilder {
if (NumBytes > 1)
Ty = llvm::ArrayType::get(Ty, NumBytes);
- llvm::Constant *Padding = llvm::UndefValue::get(Ty);
+ llvm::Constant *Padding = llvm::Constant::getNullValue(Ty);
PackedElements.push_back(Padding);
ElementOffsetInBytes += getSizeInBytes(Padding);
}
@@ -509,7 +509,7 @@ public:
if (NumPadBytes > 1)
Ty = llvm::ArrayType::get(Ty, NumPadBytes);
- Elts.push_back(llvm::UndefValue::get(Ty));
+ Elts.push_back(llvm::Constant::getNullValue(Ty));
Types.push_back(Ty);
}
OpenPOWER on IntegriCloud