Skip to content

Commit de1dd8b

Browse files
committed
Auto merge of #138503 - bjorn3:string_merging, r=tmiasko
Avoid wrapping constant allocations in packed structs when not necessary This way LLVM will set the string merging flag if the alloc is a nul terminated string, reducing binary sizes. try-job: armhf-gnu
2 parents b25a593 + 2f5aa08 commit de1dd8b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/consts.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ pub fn const_alloc_to_gcc<'gcc>(
364364
llvals.push(cx.const_bytes(bytes));
365365
}
366366

367+
// FIXME(bjorn3) avoid wrapping in a struct when there is only a single element.
367368
cx.const_struct(&llvals, true)
368369
}
369370

0 commit comments

Comments
 (0)