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
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp
index 172a77d..c57cf5b 100644
--- a/clang/lib/CodeGen/CGExprConstant.cpp
+++ b/clang/lib/CodeGen/CGExprConstant.cpp
@@ -231,7 +231,7 @@
     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 @@
         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 @@
         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);
       }