diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-03-28 03:10:45 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-03-28 03:10:45 +0000 |
commit | ccf0ed885952a52caa25767c787e0bf29f4688bd (patch) | |
tree | 9319e9189829061bef29a6a83d8c0104e9f4428e /lib/CodeGen | |
parent | daa24a29f881fb2ae53c4022e593eda1adf4b95b (diff) |
Minor cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67896 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGExprAgg.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index f3c1a9187b..095e2240cf 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -313,17 +313,7 @@ void AggExprEmitter::EmitNullInitializationToLValue(LValue LV, QualType T) { // There's a potential optimization opportunity in combining // memsets; that would be easy for arrays, but relatively // difficult for structures with the current code. - const llvm::Type *SizeTy = llvm::Type::Int64Ty; - llvm::Value *MemSet = CGF.CGM.getIntrinsic(llvm::Intrinsic::memset, - &SizeTy, 1); - uint64_t Size = CGF.getContext().getTypeSize(T); - - const llvm::Type *BP = llvm::PointerType::getUnqual(llvm::Type::Int8Ty); - llvm::Value* DestPtr = Builder.CreateBitCast(LV.getAddress(), BP, "tmp"); - Builder.CreateCall4(MemSet, DestPtr, - llvm::ConstantInt::get(llvm::Type::Int8Ty, 0), - llvm::ConstantInt::get(SizeTy, Size/8), - llvm::ConstantInt::get(llvm::Type::Int32Ty, 0)); + CGF.EmitMemSetToZero(LV.getAddress(), T); } } |