Skip to content

Commit 762ce32

Browse files
committed
stop applying noinline to glue code
1 parent 36edd25 commit 762ce32

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/librustc/middle/trans/base.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,15 @@ pub fn get_tydesc(ccx: @crate_ctxt, t: ty::t) -> @mut tydesc_info {
382382
}
383383
}
384384

385+
pub fn set_optimize_for_size(f: ValueRef) {
386+
unsafe {
387+
llvm::LLVMAddFunctionAttr(f,
388+
lib::llvm::OptimizeForSizeAttribute
389+
as c_ulonglong,
390+
0u as c_ulonglong);
391+
}
392+
}
393+
385394
pub fn set_no_inline(f: ValueRef) {
386395
unsafe {
387396
llvm::LLVMAddFunctionAttr(f,
@@ -440,7 +449,7 @@ pub fn set_custom_stack_growth_fn(f: ValueRef) {
440449

441450
pub fn set_glue_inlining(f: ValueRef, t: ty::t) {
442451
if ty::type_is_structural(t) {
443-
set_no_inline(f);
452+
set_optimize_for_size(f);
444453
} else { set_always_inline(f); }
445454
}
446455

0 commit comments

Comments
 (0)