Skip to content

Commit c9e996f

Browse files
committed
Remove support for datalayout upgrade
Only keep the downgrade code
1 parent 8b19922 commit c9e996f

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

src/librustc_codegen_llvm/context.rs

+2-16
Original file line numberDiff line numberDiff line change
@@ -147,18 +147,6 @@ fn strip_x86_address_spaces(data_layout: String) -> String {
147147
data_layout.replace("-p270:32:32-p271:32:32-p272:64:64-", "-")
148148
}
149149

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) && data_layout.starts_with("e-m:") {
153-
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-
}
161-
162150
pub unsafe fn create_module(
163151
tcx: TyCtxt<'_>,
164152
llcx: &'ll llvm::Context,
@@ -172,11 +160,9 @@ pub unsafe fn create_module(
172160
if llvm_util::get_major_version() < 9 {
173161
target_data_layout = strip_function_ptr_alignment(target_data_layout);
174162
}
175-
if sess.target.target.arch == "x86" || sess.target.target.arch == "x86_64" {
176-
if llvm_util::get_major_version() < 10 {
163+
if llvm_util::get_major_version() < 10 {
164+
if sess.target.target.arch == "x86" || sess.target.target.arch == "x86_64" {
177165
target_data_layout = strip_x86_address_spaces(target_data_layout);
178-
} else {
179-
target_data_layout = add_x86_address_spaces(target_data_layout);
180166
}
181167
}
182168

0 commit comments

Comments
 (0)