[llvm-dev] ObjCARC Passes not expanding callsites

Zhang via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 5 02:14:22 PST 2018


Hi:
One of my users suggested that my transform passes yields unlinkable object files. I ran llvm-nm on the input Bitcode and noticed there is one remaining clang.arc.use callsite like the following:


```
.....
call void (...) @clang.arc.use(i8* bitcast (%struct.__NSConstantString_tag* @_unnamed_cfstring_.4 to i8*)) #5, !dbg !74
.....
!llvm.dbg.cu = !{!0}
!clang.arc.retainAutoreleasedReturnValueMarker = !{!18}
!llvm.module.flags = !{!19, !20, !21, !22, !23, !24, !25, !26, !27}
!llvm.linker.options = !{!28, !29, !30, !31}
!llvm.ident = !{!32}

```
I then tried to skip the transform pass entirely and manually Expand ARC markers using the following command:


```
λ : >>> bin/opt -objc-arc-expand ~/Downloads/OBDemo.bc -objc-arc -o OBDemoNoARC.bc
λ : >>> bin/llvm-nm OBDemoNoARC.bc
---------------- t +[OBDemo P1]
---------------- t +[OBDemo myName]
                 U _NSLog
                 U _OBJC_CLASS_$_NSArray
                 U _OBJC_CLASS_$_NSObject
                 U _OBJC_CLASS_$_NSString
---------------- D _OBJC_CLASS_$_OBDemo
                 U _OBJC_METACLASS_$_NSObject
---------------- D _OBJC_METACLASS_$_OBDemo
                 U ___CFConstantStringClassReference
                 U __objc_empty_cache
                 U _clang.arc.use
                 U _objc_msgSend
                 U _objc_release
                 U _objc_retainAutoreleasedReturnValue

```


Which you can see the function is still referenced.
 I don't have a reproducible ObjC Code for this issue since the users said, which I quote here "I changed another computer and the issue no longer appears, magic".


So, my question is, are those passes supposed to ignore such callsites or am I doing something really wrong here?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181105/ebb21ebe/attachment.html>


More information about the llvm-dev mailing list