We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36edd25 commit 762ce32Copy full SHA for 762ce32
src/librustc/middle/trans/base.rs
@@ -382,6 +382,15 @@ pub fn get_tydesc(ccx: @crate_ctxt, t: ty::t) -> @mut tydesc_info {
382
}
383
384
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
+
394
pub fn set_no_inline(f: ValueRef) {
395
unsafe {
396
llvm::LLVMAddFunctionAttr(f,
@@ -440,7 +449,7 @@ pub fn set_custom_stack_growth_fn(f: ValueRef) {
440
449
441
450
pub fn set_glue_inlining(f: ValueRef, t: ty::t) {
442
451
if ty::type_is_structural(t) {
443
- set_no_inline(f);
452
+ set_optimize_for_size(f);
444
453
} else { set_always_inline(f); }
445
454
446
455
0 commit comments