Skip to content

Commit

Permalink
Explain why we're sorting the modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgalenson committed Aug 8, 2019
1 parent a46e36f commit 3e6a927
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/librustc_codegen_llvm/back/lto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ fn fat_lto(cgcx: &CodegenContext<LlvmCodegenBackend>,
}
}
}).collect::<Vec<_>>();
// Sort the modules to ensure we produce deterministic results.
new_modules.sort_by(|module1, module2| module1.1.partial_cmp(&module2.1).unwrap());
serialized_modules.extend(new_modules);
serialized_modules.extend(cached_modules.into_iter().map(|(buffer, wp)| {
Expand Down

0 comments on commit 3e6a927

Please sign in to comment.