diff options
Diffstat (limited to 'lib/CodeGen/CGExprAgg.cpp')
-rw-r--r-- | lib/CodeGen/CGExprAgg.cpp | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index 13c07c9596..c007cc0ae9 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -114,24 +114,7 @@ public: void AggExprEmitter::EmitAggregateClear(llvm::Value *DestPtr, QualType Ty) { assert(!Ty->isAnyComplexType() && "Shouldn't happen for complex"); - // Aggregate assignment turns into llvm.memset. - const llvm::Type *BP = llvm::PointerType::getUnqual(llvm::Type::Int8Ty); - if (DestPtr->getType() != BP) - DestPtr = Builder.CreateBitCast(DestPtr, BP, "tmp"); - - // Get size and alignment info for this aggregate. - std::pair<uint64_t, unsigned> TypeInfo = CGF.getContext().getTypeInfo(Ty); - - // FIXME: Handle variable sized types. - const llvm::Type *IntPtr = llvm::IntegerType::get(CGF.LLVMPointerWidth); - - Builder.CreateCall4(CGF.CGM.getMemSetFn(), - DestPtr, - llvm::ConstantInt::getNullValue(llvm::Type::Int8Ty), - // TypeInfo.first describes size in bits. - llvm::ConstantInt::get(IntPtr, TypeInfo.first/8), - llvm::ConstantInt::get(llvm::Type::Int32Ty, - TypeInfo.second/8)); + CGF.EmitMemSetToZero(DestPtr, Ty); } void AggExprEmitter::EmitAggregateCopy(llvm::Value *DestPtr, |