mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 15:13:49 -04:00
Reapply: IR: add optional type to 'byval' function parameters
When we switch to opaque pointer types we will need some way to describe how many bytes a 'byval' parameter should occupy on the stack. This adds a (for now) optional extra type parameter. If present, the type must match the pointee type of the argument. The original commit did not remap byval types when linking modules, which broke LTO. This version fixes that. Note to front-end maintainers: if this causes test failures, it's probably because the "byval" attribute is printed after attributes without any parameter after this change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362128 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -529,7 +529,7 @@ declare void @f.param.signext(i8 signext)
|
||||
declare void @f.param.inreg(i8 inreg)
|
||||
; CHECK: declare void @f.param.inreg(i8 inreg)
|
||||
declare void @f.param.byval({ i8, i8 }* byval)
|
||||
; CHECK: declare void @f.param.byval({ i8, i8 }* byval)
|
||||
; CHECK: declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
|
||||
declare void @f.param.inalloca(i8* inalloca)
|
||||
; CHECK: declare void @f.param.inalloca(i8* inalloca)
|
||||
declare void @f.param.sret(i8* sret)
|
||||
@@ -1735,6 +1735,15 @@ define i8** @constexpr() {
|
||||
declare void @llvm.test.immarg.intrinsic(i32 immarg)
|
||||
; CHECK: declare void @llvm.test.immarg.intrinsic(i32 immarg)
|
||||
|
||||
; byval attribute with type
|
||||
%named_type = type [8 x i8]
|
||||
declare void @byval_type(i32* byval(i32) align 2)
|
||||
declare void @byval_type2({ i8, i8* }* byval({ i8, i8* }))
|
||||
declare void @byval_named_type(%named_type* byval(%named_type))
|
||||
; CHECK: declare void @byval_type(i32* byval(i32) align 2)
|
||||
; CHECK: declare void @byval_type2({ i8, i8* }* byval({ i8, i8* }))
|
||||
; CHECK: declare void @byval_named_type([8 x i8]* byval([8 x i8]))
|
||||
|
||||
; CHECK: attributes #0 = { alignstack=4 }
|
||||
; CHECK: attributes #1 = { alignstack=8 }
|
||||
; CHECK: attributes #2 = { alwaysinline }
|
||||
|
||||
Reference in New Issue
Block a user