diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-03-07 21:18:31 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-03-07 21:18:31 +0000 |
commit | 76ecdfc53778a8468b7177c556fdbfe797fdbb29 (patch) | |
tree | c2b806d5b611749e9044d53d50615fe8b4d0f02f /lib/CodeGen | |
parent | f302354a7d1a63186fb0d9aa600ce3257be1f690 (diff) |
Remove temporary std::vectors that ca be replaced with ArrayRef's magic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176653 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGObjC.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index 540baa13b7..235b0dac1d 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -1732,9 +1732,8 @@ static llvm::Value *emitARCValueOperation(CodeGenFunction &CGF, if (isa<llvm::ConstantPointerNull>(value)) return value; if (!fn) { - std::vector<llvm::Type*> args(1, CGF.Int8PtrTy); llvm::FunctionType *fnType = - llvm::FunctionType::get(CGF.Int8PtrTy, args, false); + llvm::FunctionType::get(CGF.Int8PtrTy, CGF.Int8PtrTy, false); fn = createARCRuntimeFunction(CGF.CGM, fnType, fnName); } @@ -1758,9 +1757,8 @@ static llvm::Value *emitARCLoadOperation(CodeGenFunction &CGF, llvm::Constant *&fn, StringRef fnName) { if (!fn) { - std::vector<llvm::Type*> args(1, CGF.Int8PtrPtrTy); llvm::FunctionType *fnType = - llvm::FunctionType::get(CGF.Int8PtrTy, args, false); + llvm::FunctionType::get(CGF.Int8PtrTy, CGF.Int8PtrPtrTy, false); fn = createARCRuntimeFunction(CGF.CGM, fnType, fnName); } @@ -1821,7 +1819,8 @@ static void emitARCCopyOperation(CodeGenFunction &CGF, assert(dst->getType() == src->getType()); if (!fn) { - std::vector<llvm::Type*> argTypes(2, CGF.Int8PtrPtrTy); + llvm::Type *argTypes[] = { CGF.Int8PtrPtrTy, CGF.Int8PtrPtrTy }; + llvm::FunctionType *fnType = llvm::FunctionType::get(CGF.Builder.getVoidTy(), argTypes, false); fn = createARCRuntimeFunction(CGF.CGM, fnType, fnName); @@ -1939,9 +1938,8 @@ void CodeGenFunction::EmitARCRelease(llvm::Value *value, bool precise) { llvm::Constant *&fn = CGM.getARCEntrypoints().objc_release; if (!fn) { - std::vector<llvm::Type*> args(1, Int8PtrTy); llvm::FunctionType *fnType = - llvm::FunctionType::get(Builder.getVoidTy(), args, false); + llvm::FunctionType::get(Builder.getVoidTy(), Int8PtrTy, false); fn = createARCRuntimeFunction(CGM, fnType, "objc_release"); } @@ -2148,9 +2146,8 @@ void CodeGenFunction::EmitARCInitWeak(llvm::Value *addr, llvm::Value *value) { void CodeGenFunction::EmitARCDestroyWeak(llvm::Value *addr) { llvm::Constant *&fn = CGM.getARCEntrypoints().objc_destroyWeak; if (!fn) { - std::vector<llvm::Type*> args(1, Int8PtrPtrTy); llvm::FunctionType *fnType = - llvm::FunctionType::get(Builder.getVoidTy(), args, false); + llvm::FunctionType::get(Builder.getVoidTy(), Int8PtrPtrTy, false); fn = createARCRuntimeFunction(CGM, fnType, "objc_destroyWeak"); } @@ -2198,9 +2195,8 @@ void CodeGenFunction::EmitObjCAutoreleasePoolPop(llvm::Value *value) { llvm::Constant *&fn = CGM.getRREntrypoints().objc_autoreleasePoolPop; if (!fn) { - std::vector<llvm::Type*> args(1, Int8PtrTy); llvm::FunctionType *fnType = - llvm::FunctionType::get(Builder.getVoidTy(), args, false); + llvm::FunctionType::get(Builder.getVoidTy(), Int8PtrTy, false); // We don't want to use a weak import here; instead we should not // fall into this path. |