diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2014-01-30 00:16:39 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-01-30 00:16:39 +0000 |
commit | 13b4304937baf3e74a33cfd81a0494a01f8f1b01 (patch) | |
tree | 8a99e387121482279d141b93c819bc388dcba6d2 /clang/lib/CodeGen/CGObjC.cpp | |
parent | 1ba73059744e514188d49e52c00804dbd47d20a1 (diff) | |
download | bcm5719-llvm-13b4304937baf3e74a33cfd81a0494a01f8f1b01.tar.gz bcm5719-llvm-13b4304937baf3e74a33cfd81a0494a01f8f1b01.zip |
Objective-C [IRGen]. Generator a tail call to objc_getProperty() in
synthesized getters for performance improvement.
// rdar://15884113
llvm-svn: 200430
Diffstat (limited to 'clang/lib/CodeGen/CGObjC.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGObjC.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp index 9c23ba4b1ee..ae1349fbd8a 100644 --- a/clang/lib/CodeGen/CGObjC.cpp +++ b/clang/lib/CodeGen/CGObjC.cpp @@ -892,10 +892,14 @@ CodeGenFunction::generateObjCGetterBody(const ObjCImplementationDecl *classImpl, // FIXME: We shouldn't need to get the function info here, the // runtime already should have computed it to build the function. + llvm::Instruction *CallInstruction; RValue RV = EmitCall(getTypes().arrangeFreeFunctionCall(propType, args, FunctionType::ExtInfo(), RequiredArgs::All), - getPropertyFn, ReturnValueSlot(), args); + getPropertyFn, ReturnValueSlot(), args, 0, + &CallInstruction); + if (llvm::CallInst *call = dyn_cast<llvm::CallInst>(CallInstruction)) + call->setTailCall(); // We need to fix the type here. Ivars with copy & retain are // always objects so we don't need to worry about complex or |