aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGExprAgg.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-05-22 17:35:42 +0000
committerAnders Carlsson <andersca@mac.com>2010-05-22 17:35:42 +0000
commitc0964b60e501872e35c51db23f5fe6a6a5523091 (patch)
tree07a2ceb59aeb2463a21a30b0cc6ee40c64509bca /clang/lib/CodeGen/CGExprAgg.cpp
parent024d80e571ae0fc97ca731e0a56faac56f20841a (diff)
downloadllvm-c0964b60e501872e35c51db23f5fe6a6a5523091.zip
llvm-c0964b60e501872e35c51db23f5fe6a6a5523091.tar.gz
llvm-c0964b60e501872e35c51db23f5fe6a6a5523091.tar.bz2
Re-land the fix for PR7139.
llvm-svn: 104446
Diffstat (limited to 'clang/lib/CodeGen/CGExprAgg.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprAgg.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp
index 7b0c316..18c69121 100644
--- a/clang/lib/CodeGen/CGExprAgg.cpp
+++ b/clang/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);
}
}