File tree 3 files changed +13
-3
lines changed
3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,8 @@ pub unsafe fn create_module<'ll>(
134
134
let llmod = llvm:: LLVMModuleCreateWithNameInContext ( mod_name. as_ptr ( ) , llcx) ;
135
135
136
136
let mut target_data_layout = sess. target . data_layout . clone ( ) ;
137
- if llvm_util:: get_version ( ) < ( 13 , 0 , 0 ) {
137
+ let llvm_version = llvm_util:: get_version ( ) ;
138
+ if llvm_version < ( 13 , 0 , 0 ) {
138
139
if sess. target . arch == "powerpc64" {
139
140
target_data_layout = target_data_layout. replace ( "-S128" , "" ) ;
140
141
}
@@ -145,6 +146,15 @@ pub unsafe fn create_module<'ll>(
145
146
target_data_layout = "e-m:e-p:64:64-i64:64-n32:64-S128" . to_string ( ) ;
146
147
}
147
148
}
149
+ if llvm_version < ( 14 , 0 , 0 ) {
150
+ if sess. target . llvm_target == "i686-pc-windows-msvc"
151
+ || sess. target . llvm_target == "i586-pc-windows-msvc"
152
+ {
153
+ target_data_layout =
154
+ "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:32-n8:16:32-a:0:32-S32"
155
+ . to_string ( ) ;
156
+ }
157
+ }
148
158
149
159
// Ensure the data-layout values hardcoded remain the defaults.
150
160
if sess. target . is_builtin {
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ pub fn target() -> Target {
24
24
llvm_target : "i686-pc-windows-msvc" . to_string ( ) ,
25
25
pointer_width : 32 ,
26
26
data_layout : "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
27
- i64:64-f80:32 -n8:16:32-a:0:32-S32"
27
+ i64:64-f80:128 -n8:16:32-a:0:32-S32"
28
28
. to_string ( ) ,
29
29
arch : "x86" . to_string ( ) ,
30
30
options : base,
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ pub fn target() -> Target {
9
9
llvm_target : "i686-pc-windows-msvc" . to_string ( ) ,
10
10
pointer_width : 32 ,
11
11
data_layout : "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
12
- i64:64-f80:32 -n8:16:32-a:0:32-S32"
12
+ i64:64-f80:128 -n8:16:32-a:0:32-S32"
13
13
. to_string ( ) ,
14
14
arch : "x86" . to_string ( ) ,
15
15
options : base,
You can’t perform that action at this time.
0 commit comments