diff options
| author | Pete Cooper <peter_cooper@apple.com> | 2018-12-08 05:13:50 +0000 |
|---|---|---|
| committer | Pete Cooper <peter_cooper@apple.com> | 2018-12-08 05:13:50 +0000 |
| commit | e388680dfa178e5f433f766b51fea2471c40d7be (patch) | |
| tree | 3231e86f4cca324be840149b2ee599aeca25db64 /clang/lib/CodeGen/CodeGenFunction.h | |
| parent | d076608d58d1ec55016eb747a995511e3a3f72aa (diff) | |
| download | bcm5719-llvm-e388680dfa178e5f433f766b51fea2471c40d7be.tar.gz bcm5719-llvm-e388680dfa178e5f433f766b51fea2471c40d7be.zip | |
Convert some ObjC msgSends to runtime calls.
It is faster to directly call the ObjC runtime for methods such as alloc/allocWithZone instead of sending a message to those functions.
This patch adds support for converting messages to alloc/allocWithZone to their equivalent runtime calls.
Tests included for the positive case of applying this transformation, negative tests that we ensure we only convert "alloc" to objc_alloc, not "alloc2", and also a driver test to ensure we enable this only for supported runtime versions.
Reviewed By: rjmccall
https://reviews.llvm.org/D55349
llvm-svn: 348687
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index ab7305a1124..9b802991e70 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -3805,6 +3805,10 @@ public: std::pair<LValue,llvm::Value*> EmitARCStoreUnsafeUnretained(const BinaryOperator *e, bool ignored); + llvm::Value *EmitObjCAlloc(llvm::Value *value, + llvm::Type *returnType); + llvm::Value *EmitObjCAllocWithZone(llvm::Value *value, + llvm::Type *returnType); llvm::Value *EmitObjCThrowOperand(const Expr *expr); llvm::Value *EmitObjCConsumeObject(QualType T, llvm::Value *Ptr); llvm::Value *EmitObjCExtendObjectLifetime(QualType T, llvm::Value *Ptr); |

