diff options
| author | bors <bors@rust-lang.org> | 2015-09-14 11:05:34 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-09-14 11:05:34 +0000 |
| commit | 2d4ae52cbdca96d4dd6d5a009e4a5ef87a279df0 (patch) | |
| tree | 782f1b598d547a1d7b62afe14809b84aa82d11f7 /src/libstd | |
| parent | 664a45976fb5dd433766f73a221435883151d0ee (diff) | |
| parent | 3ef75d5774cb9a7cf839a69341c620b98fa9c7df (diff) | |
| download | rust-2d4ae52cbdca96d4dd6d5a009e4a5ef87a279df0.tar.gz rust-2d4ae52cbdca96d4dd6d5a009e4a5ef87a279df0.zip | |
Auto merge of #28358 - dotdash:nounwind, r=alexcrichton
This allows to skip the codegen for all the unneeded landing pads, reducing code size across the board by about 2-5%, depending on the crate. Compile times seem to be pretty unaffected though :-/
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/lib.rs | 1 | ||||
| -rw-r--r-- | src/libstd/sys/common/libunwind.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/common/unwind/mod.rs | 1 | ||||
| -rw-r--r-- | src/libstd/sys/common/unwind/seh.rs | 1 | ||||
| -rw-r--r-- | src/libstd/sys/common/unwind/seh64_gnu.rs | 2 |
5 files changed, 7 insertions, 0 deletions
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 868fef06aa4..774d13966bd 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -242,6 +242,7 @@ #![feature(unique)] #![feature(unsafe_no_drop_flag, filling_drop)] #![feature(decode_utf16)] +#![feature(unwind_attributes)] #![feature(vec_push_all)] #![feature(vec_resize)] #![feature(wrapping)] diff --git a/src/libstd/sys/common/libunwind.rs b/src/libstd/sys/common/libunwind.rs index fde612014e9..c6bffb0f733 100644 --- a/src/libstd/sys/common/libunwind.rs +++ b/src/libstd/sys/common/libunwind.rs @@ -124,10 +124,12 @@ extern "C" { // iOS on armv7 uses SjLj exceptions and requires to link // against corresponding routine (..._SjLj_...) #[cfg(not(all(target_os = "ios", target_arch = "arm")))] + #[unwind] pub fn _Unwind_RaiseException(exception: *mut _Unwind_Exception) -> _Unwind_Reason_Code; #[cfg(all(target_os = "ios", target_arch = "arm"))] + #[unwind] fn _Unwind_SjLj_RaiseException(e: *mut _Unwind_Exception) -> _Unwind_Reason_Code; diff --git a/src/libstd/sys/common/unwind/mod.rs b/src/libstd/sys/common/unwind/mod.rs index ff93d0526b7..738681c3cfe 100644 --- a/src/libstd/sys/common/unwind/mod.rs +++ b/src/libstd/sys/common/unwind/mod.rs @@ -192,6 +192,7 @@ fn rust_panic(cause: Box<Any + Send + 'static>) -> ! { #[cfg(not(test))] /// Entry point of panic from the libcore crate. #[lang = "panic_fmt"] +#[unwind] pub extern fn rust_begin_unwind(msg: fmt::Arguments, file: &'static str, line: u32) -> ! { begin_unwind_fmt(msg, &(file, line)) diff --git a/src/libstd/sys/common/unwind/seh.rs b/src/libstd/sys/common/unwind/seh.rs index a201e406a23..a89e8b499ac 100644 --- a/src/libstd/sys/common/unwind/seh.rs +++ b/src/libstd/sys/common/unwind/seh.rs @@ -62,6 +62,7 @@ static PANIC_DATA: StaticKey = StaticKey::new(None); // This function is provided by kernel32.dll extern "system" { + #[unwind] fn RaiseException(dwExceptionCode: DWORD, dwExceptionFlags: DWORD, nNumberOfArguments: DWORD, diff --git a/src/libstd/sys/common/unwind/seh64_gnu.rs b/src/libstd/sys/common/unwind/seh64_gnu.rs index 4d23794de24..9478678fda9 100644 --- a/src/libstd/sys/common/unwind/seh64_gnu.rs +++ b/src/libstd/sys/common/unwind/seh64_gnu.rs @@ -93,6 +93,7 @@ pub enum EXCEPTION_DISPOSITION { // From kernel32.dll extern "system" { + #[unwind] fn RaiseException(dwExceptionCode: DWORD, dwExceptionFlags: DWORD, nNumberOfArguments: DWORD, @@ -198,6 +199,7 @@ unsafe extern fn rust_eh_personality( #[lang = "eh_unwind_resume"] #[cfg(not(test))] +#[unwind] unsafe extern fn rust_eh_unwind_resume(panic_ctx: LPVOID) { let params = [panic_ctx as ULONG_PTR]; RaiseException(RUST_PANIC, |
