@@ -59,6 +59,9 @@ impl ArgAttributesExt for ArgAttributes {
59
59
llattr. apply_llfn ( idx, llfn) ;
60
60
}
61
61
}
62
+ if let Some ( align) = self . pointee_align {
63
+ llvm:: LLVMRustAddAlignmentAttr ( llfn, idx. as_uint ( ) , align. bytes ( ) as u32 ) ;
64
+ }
62
65
match self . arg_ext {
63
66
ArgExtension :: None => { }
64
67
ArgExtension :: Zext => llvm:: Attribute :: ZExt . apply_llfn ( idx, llfn) ,
@@ -77,9 +80,6 @@ impl ArgAttributesExt for ArgAttributes {
77
80
}
78
81
regular -= ArgAttribute :: NonNull ;
79
82
}
80
- if let Some ( align) = self . pointee_align {
81
- llvm:: LLVMRustAddAlignmentAttr ( llfn, idx. as_uint ( ) , align. bytes ( ) as u32 ) ;
82
- }
83
83
for ( attr, llattr) in OPTIMIZATION_ATTRIBUTES {
84
84
if regular. contains ( attr) {
85
85
llattr. apply_llfn ( idx, llfn) ;
@@ -105,6 +105,13 @@ impl ArgAttributesExt for ArgAttributes {
105
105
llattr. apply_callsite ( idx, callsite) ;
106
106
}
107
107
}
108
+ if let Some ( align) = self . pointee_align {
109
+ llvm:: LLVMRustAddAlignmentCallSiteAttr (
110
+ callsite,
111
+ idx. as_uint ( ) ,
112
+ align. bytes ( ) as u32 ,
113
+ ) ;
114
+ }
108
115
match self . arg_ext {
109
116
ArgExtension :: None => { }
110
117
ArgExtension :: Zext => llvm:: Attribute :: ZExt . apply_callsite ( idx, callsite) ,
@@ -127,13 +134,6 @@ impl ArgAttributesExt for ArgAttributes {
127
134
}
128
135
regular -= ArgAttribute :: NonNull ;
129
136
}
130
- if let Some ( align) = self . pointee_align {
131
- llvm:: LLVMRustAddAlignmentCallSiteAttr (
132
- callsite,
133
- idx. as_uint ( ) ,
134
- align. bytes ( ) as u32 ,
135
- ) ;
136
- }
137
137
for ( attr, llattr) in OPTIMIZATION_ATTRIBUTES {
138
138
if regular. contains ( attr) {
139
139
llattr. apply_callsite ( idx, callsite) ;
0 commit comments