File: pointer-types.ll

package info (click to toggle)
llvm-toolchain-5.0 1:5.0.1-2~bpo9+1
  • links: PTS, VCS
  • area: main
  • in suites: stretch-backports
  • size: 553,688 kB
  • sloc: cpp: 2,878,786; ansic: 584,110; asm: 246,252; python: 124,751; objc: 106,925; sh: 21,542; lisp: 8,628; pascal: 5,885; ml: 5,544; perl: 5,312; makefile: 2,208; cs: 2,022; xml: 686; php: 212; csh: 117
file content (31 lines) | stat: -rw-r--r-- 1,031 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
; RUN: opt -objc-arc -S < %s | FileCheck %s

; Don't hoist @objc_release past a use of its pointer, even
; if the use has function type, because clang uses function types
; in dubious ways.
; rdar://10551239

; CHECK-LABEL: define void @test0(
; CHECK: %otherBlock = phi void ()* [ %b1, %if.then ], [ null, %entry ]
; CHECK-NEXT: call void @use_fptr(void ()* %otherBlock)
; CHECK-NEXT: %tmp11 = bitcast void ()* %otherBlock to i8*
; CHECK-NEXT: call void @objc_release(i8* %tmp11)

define void @test0(i1 %tobool, void ()* %b1) {
entry:
  br i1 %tobool, label %if.end, label %if.then

if.then:                                          ; preds = %entry
  br label %if.end

if.end:                                           ; preds = %if.then, %entry
  %otherBlock = phi void ()* [ %b1, %if.then ], [ null, %entry ]
  call void @use_fptr(void ()* %otherBlock)
  %tmp11 = bitcast void ()* %otherBlock to i8*
  call void @objc_release(i8* %tmp11) nounwind
  ret void
}

declare void @use_fptr(void ()*)
declare void @objc_release(i8*)