diff options
| author | bors <bors@rust-lang.org> | 2021-03-14 11:46:57 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-03-14 11:46:57 +0000 |
| commit | 84c08f82b46986fcd5cbd1a637582bd1325fa970 (patch) | |
| tree | 6678d7e243f4636cb97dda900790c6cdc687d091 /compiler/rustc_codegen_llvm/src/back/write.rs | |
| parent | f293f70dd848ae2371b6fad2eb9f4081e920da88 (diff) | |
| parent | 71418384d7d37b37eef250291ea8015667a81f17 (diff) | |
| download | rust-84c08f82b46986fcd5cbd1a637582bd1325fa970.tar.gz rust-84c08f82b46986fcd5cbd1a637582bd1325fa970.zip | |
Auto merge of #83044 - kubo39:set-llvm-code-model, r=nikic
Add support for storing code model to LLVM module IR This patch avoids undefined behavior by linking different object files. Also this would it could be propagated properly to LTO. See https://reviews.llvm.org/D52322 and https://reviews.llvm.org/D52323. This patch is based on https://github.com/rust-lang/rust/pull/74002
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/back/write.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/back/write.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs index c224da7885b..4b7bcf05501 100644 --- a/compiler/rustc_codegen_llvm/src/back/write.rs +++ b/compiler/rustc_codegen_llvm/src/back/write.rs @@ -140,7 +140,7 @@ fn to_llvm_relocation_model(relocation_model: RelocModel) -> llvm::RelocModel { } } -fn to_llvm_code_model(code_model: Option<CodeModel>) -> llvm::CodeModel { +pub(crate) fn to_llvm_code_model(code_model: Option<CodeModel>) -> llvm::CodeModel { match code_model { Some(CodeModel::Tiny) => llvm::CodeModel::Tiny, Some(CodeModel::Small) => llvm::CodeModel::Small, |
