summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2010-03-30 22:28:46 +0000
committerBob Wilson <bob.wilson@apple.com>2010-03-30 22:28:46 +0000
commitadb58e32cc2afcced85afb7d7b3938310683099f (patch)
treeff52a6a0d7dc8466bfff45aa5302c13d3a3956fc /clang/lib/CodeGen/CodeGenModule.cpp
parent6f7fd28824f4ad6682732c9a81f9d0ffb38ff494 (diff)
downloadbcm5719-llvm-adb58e32cc2afcced85afb7d7b3938310683099f.tar.gz
bcm5719-llvm-adb58e32cc2afcced85afb7d7b3938310683099f.zip
Revert Mon Ping's 99930 due to broken llvm-gcc buildbots.
llvm-svn: 99949
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp30
1 files changed, 14 insertions, 16 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 124c4d83c7c..c44b3119722 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -47,7 +47,8 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO,
Features(C.getLangOptions()), CodeGenOpts(CGO), TheModule(M),
TheTargetData(TD), TheTargetCodeGenInfo(0), Diags(diags),
Types(C, M, TD, getTargetCodeGenInfo().getABIInfo()),
- MangleCtx(C), VTables(*this), Runtime(0), CFConstantStringClassRef(0),
+ MangleCtx(C), VTables(*this), Runtime(0),
+ MemCpyFn(0), MemMoveFn(0), MemSetFn(0), CFConstantStringClassRef(0),
VMContext(M.getContext()) {
if (!Features.ObjC1)
@@ -1413,25 +1414,22 @@ llvm::Function *CodeGenModule::getIntrinsic(unsigned IID,const llvm::Type **Tys,
(llvm::Intrinsic::ID)IID, Tys, NumTys);
}
-
-llvm::Function *CodeGenModule::getMemCpyFn(const llvm::Type *DestType,
- const llvm::Type *SrcType,
- const llvm::Type *SizeType) {
- const llvm::Type *ArgTypes[3] = {DestType, SrcType, SizeType };
- return getIntrinsic(llvm::Intrinsic::memcpy, ArgTypes, 3);
+llvm::Function *CodeGenModule::getMemCpyFn() {
+ if (MemCpyFn) return MemCpyFn;
+ const llvm::Type *IntPtr = TheTargetData.getIntPtrType(VMContext);
+ return MemCpyFn = getIntrinsic(llvm::Intrinsic::memcpy, &IntPtr, 1);
}
-llvm::Function *CodeGenModule::getMemMoveFn(const llvm::Type *DestType,
- const llvm::Type *SrcType,
- const llvm::Type *SizeType) {
- const llvm::Type *ArgTypes[3] = {DestType, SrcType, SizeType };
- return getIntrinsic(llvm::Intrinsic::memmove, ArgTypes, 3);
+llvm::Function *CodeGenModule::getMemMoveFn() {
+ if (MemMoveFn) return MemMoveFn;
+ const llvm::Type *IntPtr = TheTargetData.getIntPtrType(VMContext);
+ return MemMoveFn = getIntrinsic(llvm::Intrinsic::memmove, &IntPtr, 1);
}
-llvm::Function *CodeGenModule::getMemSetFn(const llvm::Type *DestType,
- const llvm::Type *SizeType) {
- const llvm::Type *ArgTypes[2] = { DestType, SizeType };
- return getIntrinsic(llvm::Intrinsic::memset, ArgTypes, 2);
+llvm::Function *CodeGenModule::getMemSetFn() {
+ if (MemSetFn) return MemSetFn;
+ const llvm::Type *IntPtr = TheTargetData.getIntPtrType(VMContext);
+ return MemSetFn = getIntrinsic(llvm::Intrinsic::memset, &IntPtr, 1);
}
static llvm::StringMapEntry<llvm::Constant*> &
OpenPOWER on IntegriCloud