We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 326fc7b commit a182392Copy full SHA for a182392
src/librustc_codegen_llvm/context.rs
@@ -149,8 +149,12 @@ fn strip_x86_address_spaces(data_layout: String) -> String {
149
150
fn add_x86_address_spaces(mut data_layout: String) -> String {
151
let address_spaces = "-p270:32:32-p271:32:32-p272:64:64";
152
- if !data_layout.contains(address_spaces) {
153
- data_layout.insert_str("e-m:X".len(), address_spaces);
+ if !data_layout.contains(address_spaces) && data_layout.starts_with("e-m:") {
+ let mut insert_pos = "e-m:?".len();
154
+ if data_layout[insert_pos..].starts_with("-p:32:32") {
155
+ insert_pos += "-p:32:32".len();
156
+ }
157
+ data_layout.insert_str(insert_pos, address_spaces);
158
}
159
data_layout
160
0 commit comments