diff options
| author | Tom Karpiniec <tom@ditto.live> | 2020-05-08 09:48:30 +1000 |
|---|---|---|
| committer | Tom Karpiniec <tom@ditto.live> | 2020-05-08 09:48:30 +1000 |
| commit | 4fea9cdd2400f60439f96999f423f92a711b984d (patch) | |
| tree | e5ae35aad7c6d5c560d74623d09269843a98e2e1 /src/librustc_codegen_llvm | |
| parent | a390803782218807966b0999a698795b0fc5b281 (diff) | |
Simplify bitcode embedding - either None or Full
Diffstat (limited to 'src/librustc_codegen_llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/back/write.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/librustc_codegen_llvm/back/write.rs b/src/librustc_codegen_llvm/back/write.rs index d8faa82a894..e261ac65446 100644 --- a/src/librustc_codegen_llvm/back/write.rs +++ b/src/librustc_codegen_llvm/back/write.rs @@ -651,10 +651,8 @@ pub(crate) unsafe fn codegen( "LLVM_module_codegen_embed_bitcode", &module.name[..], ); - embed_bitcode(cgcx, llcx, llmod, &config.bc_cmdline, Some(data)); + embed_bitcode(cgcx, llcx, llmod, &config.bc_cmdline, data); } - } else if config.emit_obj == EmitObj::ObjectCode(BitcodeSection::Marker) { - embed_bitcode(cgcx, llcx, llmod, &config.bc_cmdline, None); } if config.emit_ir { @@ -790,9 +788,9 @@ unsafe fn embed_bitcode( llcx: &llvm::Context, llmod: &llvm::Module, cmdline: &str, - bitcode: Option<&[u8]>, + bitcode: &[u8], ) { - let llconst = common::bytes_in_context(llcx, bitcode.unwrap_or(&[])); + let llconst = common::bytes_in_context(llcx, bitcode); let llglobal = llvm::LLVMAddGlobal( llmod, common::val_ty(llconst), |
