mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
ed0ab9dc76
This patch adds a function attribute, nofree, to indicate that a function does not, directly or indirectly, call a memory-deallocation function (e.g., free, C++'s operator delete). Reviewers: jdoerfert Differential Revision: https://reviews.llvm.org/D49165 llvm-svn: 365336
18 lines
341 B
LLVM
18 lines
341 B
LLVM
; RUN: opt -S -functionattrs < %s | FileCheck %s
|
|
; RUN: opt -S -passes=function-attrs < %s | FileCheck %s
|
|
|
|
define void @f() {
|
|
; CHECK-LABEL: define void @f() #0 {
|
|
call void @g() [ "unknown"() ]
|
|
ret void
|
|
}
|
|
|
|
define void @g() {
|
|
; CHECK-LABEL: define void @g() #0 {
|
|
call void @f()
|
|
ret void
|
|
}
|
|
|
|
|
|
; CHECK: attributes #0 = { nofree nounwind }
|