diff options
author | Anders Carlsson <andersca@mac.com> | 2010-05-22 17:35:42 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-05-22 17:35:42 +0000 |
commit | 1884eb0b5c55edda4893ddec45e7dbad79758782 (patch) | |
tree | c1daa9aef185f4ba861efc8c83a3a18bb5b12201 /lib/CodeGen/CGExprAgg.cpp | |
parent | fb2db4657dc1e305c98d0c48fb1009a9f65b337a (diff) |
Re-land the fix for PR7139.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104446 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprAgg.cpp')
-rw-r--r-- | lib/CodeGen/CGExprAgg.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index 7b0c316c9d..18c69121d4 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -582,14 +582,10 @@ void AggExprEmitter::EmitNullInitializationToLValue(LValue LV, QualType T) { llvm::Value *Null = llvm::Constant::getNullValue(CGF.ConvertType(T)); CGF.EmitStoreThroughLValue(RValue::get(Null), LV, T); } else { - // Otherwise, just memset the whole thing to zero. This is legal - // because in LLVM, all default initializers are guaranteed to have a - // bit pattern of all zeros. - // FIXME: That isn't true for member pointers! // There's a potential optimization opportunity in combining // memsets; that would be easy for arrays, but relatively // difficult for structures with the current code. - CGF.EmitMemSetToZero(LV.getAddress(), T); + CGF.EmitNullInitialization(LV.getAddress(), T); } } |