Skip to content

Commit

Permalink
Ensure strings created with const_str get the unnamed_addr attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
thomcc committed Nov 15, 2023
1 parent 1db4b12 commit 268f5c5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_codegen_llvm/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ impl<'ll, 'tcx> ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> {
unsafe {
llvm::LLVMSetInitializer(g, sc);
llvm::LLVMSetGlobalConstant(g, True);
llvm::LLVMSetUnnamedAddress(g, llvm::UnnamedAddr::Global);
llvm::LLVMRustSetLinkage(g, llvm::Linkage::InternalLinkage);
}
(s.to_owned(), g)
Expand Down

0 comments on commit 268f5c5

Please sign in to comment.