diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2010-04-16 20:56:35 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2010-04-16 20:56:35 +0000 |
commit | cdb30b41590bf9e20d1d46a866fce071ebadf21a (patch) | |
tree | 0ba6645bdf019dd47fe9847de9c75c3ee78b528a /lib/CodeGen/CGExprConstant.cpp | |
parent | f0e43e5c4634870b8ac7bf65d5ffa5f292d4c8a5 (diff) |
emit padding as undef values, take 2
merge also a few tests I had here for this feature, and FileCheck'ize one file
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101535 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
-rw-r--r-- | lib/CodeGen/CGExprConstant.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index 7da7554e2c..52e7d045e6 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -259,7 +259,7 @@ void ConstStructBuilder::AppendPadding(uint64_t NumBytes) { if (NumBytes > 1) Ty = llvm::ArrayType::get(Ty, NumBytes); - llvm::Constant *C = llvm::Constant::getNullValue(Ty); + llvm::Constant *C = llvm::UndefValue::get(Ty); Elements.push_back(C); assert(getAlignment(C) == 1 && "Padding must have 1 byte alignment!"); @@ -297,7 +297,7 @@ void ConstStructBuilder::ConvertStructToPacked() { if (NumBytes > 1) Ty = llvm::ArrayType::get(Ty, NumBytes); - llvm::Constant *Padding = llvm::Constant::getNullValue(Ty); + llvm::Constant *Padding = llvm::UndefValue::get(Ty); PackedElements.push_back(Padding); ElementOffsetInBytes += getSizeInBytes(Padding); } @@ -537,7 +537,7 @@ public: if (NumPadBytes > 1) Ty = llvm::ArrayType::get(Ty, NumPadBytes); - Elts.push_back(llvm::Constant::getNullValue(Ty)); + Elts.push_back(llvm::UndefValue::get(Ty)); Types.push_back(Ty); } |