summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprAgg.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-21 16:43:15 +0000
committerChris Lattner <sabre@nondot.org>2008-11-21 16:43:15 +0000
commit0f137df0aa5aefd50f04bdf7ee5fd4d187ea3c89 (patch)
treec2076c83467b242c238d5b3edf52de297df044c3 /clang/lib/CodeGen/CGExprAgg.cpp
parentdd7083452fd0b9f69ed71e00dca3dbf41831586d (diff)
downloadbcm5719-llvm-0f137df0aa5aefd50f04bdf7ee5fd4d187ea3c89.tar.gz
bcm5719-llvm-0f137df0aa5aefd50f04bdf7ee5fd4d187ea3c89.zip
reapply the (corrected) patch to use the new llvm intrinsics for memcpy/memmove etc.
llvm-svn: 59824
Diffstat (limited to 'clang/lib/CodeGen/CGExprAgg.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprAgg.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp
index 1b554b22055..28f93c00f12 100644
--- a/clang/lib/CodeGen/CGExprAgg.cpp
+++ b/clang/lib/CodeGen/CGExprAgg.cpp
@@ -327,14 +327,16 @@ 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.
- llvm::Value *MemSet = CGF.CGM.getIntrinsic(llvm::Intrinsic::memset_i64);
+ 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(llvm::Type::Int64Ty, Size/8),
+ llvm::ConstantInt::get(SizeTy, Size/8),
llvm::ConstantInt::get(llvm::Type::Int32Ty, 0));
}
}
OpenPOWER on IntegriCloud