1
Fork 0

Codegen const panic messages as function calls

This skips emitting extra arguments at every callsite (of which there
can be many). For a librustc_driver build with overflow checks enabled,
this cuts 0.7MB from the resulting binary.
This commit is contained in:
Mark Rousskov 2024-03-17 22:26:39 -04:00
parent 0ad927c0c0
commit 00f4daa276
12 changed files with 255 additions and 63 deletions

View file

@ -4,7 +4,7 @@
//@[NOASSERT] compile-flags: -Coverflow-checks=off
// CHECK-LABEL: define{{.*}} @assertion
// ASSERT: call void @{{.*4core9panicking5panic}}
// ASSERT: call void @{{.*4core9panicking11panic_const24panic_const_add_overflow}}
// NOASSERT: ret i8 0
#[no_mangle]
pub fn assertion() -> u8 {