diff options
author | Anders Carlsson <andersca@mac.com> | 2010-05-21 21:45:41 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-05-21 21:45:41 +0000 |
commit | da1641cd1201176b1cfbc8ea7f36865733f43859 (patch) | |
tree | 401355c49bf89431fdbea2ed6f62d97d314ef0ef /clang/lib/CodeGen/CGExprAgg.cpp | |
parent | 9f44d1453b67a6d9e7acb8a68146fc23261c3e57 (diff) | |
download | bcm5719-llvm-da1641cd1201176b1cfbc8ea7f36865733f43859.tar.gz bcm5719-llvm-da1641cd1201176b1cfbc8ea7f36865733f43859.zip |
Rename CodeGenFunction::EmitMemSetToZero to EmitNullInitialization. Handle setting null data member pointers correctly. Fixes PR7139.
llvm-svn: 104387
Diffstat (limited to 'clang/lib/CodeGen/CGExprAgg.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprAgg.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp index 3bf2f8a5202..4a7e6ecc42d 100644 --- a/clang/lib/CodeGen/CGExprAgg.cpp +++ b/clang/lib/CodeGen/CGExprAgg.cpp @@ -573,14 +573,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); } } |