Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ObjC][ARC] Check whether the return and parameter types of the old and
new functions are compatible before upgrading a function call to an intrinsic call. Sometimes users insert calls to ARC runtime functions that are not compatible with the corresponding intrinsic functions (for example, 'i8* @objc_storeStrong' instead of 'void @objc_storeStrong'). Don't upgrade those calls. rdar://problem/56447127
- Loading branch information
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
target triple = "arm64-apple-ios7.0" | ||
|
||
; RUN: llvm-dis < %S/upgrade-arc-runtime-calls-bitcast.bc | FileCheck %s | ||
|
||
; CHECK: tail call i8* @objc_retain(i32 1) | ||
; CHECK: tail call i8* @objc_storeStrong( | ||
|
||
define void @testRuntimeCalls(i8* %a, i8** %b) { | ||
%v6 = tail call i8* @objc_retain(i32 1) | ||
%1 = tail call i8* @objc_storeStrong(i8** %b, i8* %a) | ||
ret void | ||
} | ||
|
||
declare i8* @objc_retain(i32) | ||
declare i8* @objc_storeStrong(i8**, i8*) | ||
|
||
attributes #0 = { nounwind } | ||
|
||
!llvm.module.flags = !{!0} | ||
|
||
!0 = !{i32 1, !"clang.arc.retainAutoreleasedReturnValueMarker", !"mov\09fp, fp\09\09; marker for objc_retainAutoreleaseReturnValue"} |