about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2016-10-19 08:00:04 +0300
committerGitHub <noreply@github.com>2016-10-19 08:00:04 +0300
commita09b94b3d9209a07c416d30baaf73fe78e84e4b8 (patch)
treec2f2efd0dbeb975fb9989426fd8b4fc62d5dea14
parent3d57d42f13a2148ecbc3686f367643ebe4b841af (diff)
parent1cc1dcce7d7e934817c3bf3543ca8e7753960d0b (diff)
downloadrust-a09b94b3d9209a07c416d30baaf73fe78e84e4b8.tar.gz
rust-a09b94b3d9209a07c416d30baaf73fe78e84e4b8.zip
Rollup merge of #37254 - srinivasreddy:master, r=alexcrichton
run rustfmt on libpanic_unwind
-rw-r--r--src/libpanic_unwind/dwarf/eh.rs10
-rw-r--r--src/libpanic_unwind/emcc.rs7
-rw-r--r--src/libpanic_unwind/gcc.rs21
-rw-r--r--src/libpanic_unwind/seh64_gnu.rs3
4 files changed, 20 insertions, 21 deletions
diff --git a/src/libpanic_unwind/dwarf/eh.rs b/src/libpanic_unwind/dwarf/eh.rs
index 2284a9bbb73..e7994f4e0ef 100644
--- a/src/libpanic_unwind/dwarf/eh.rs
+++ b/src/libpanic_unwind/dwarf/eh.rs
@@ -116,7 +116,7 @@ pub unsafe fn find_eh_action(lsda: *const u8, context: &EHContext) -> EHAction {
         // The "IP" is an index into the call-site table, with two exceptions:
         // -1 means 'no-action', and 0 means 'terminate'.
         match ip as isize {
-           -1 => return EHAction::None,
+            -1 => return EHAction::None,
             0 => return EHAction::Terminate,
             _ => (),
         }
@@ -182,12 +182,8 @@ unsafe fn read_encoded_pointer(reader: &mut DwarfReader,
             assert!(context.func_start != 0);
             context.func_start
         }
-        DW_EH_PE_textrel => {
-            (*context.get_text_start)()
-        }
-        DW_EH_PE_datarel => {
-            (*context.get_data_start)()
-        }
+        DW_EH_PE_textrel => (*context.get_text_start)(),
+        DW_EH_PE_datarel => (*context.get_data_start)(),
         _ => panic!(),
     };
 
diff --git a/src/libpanic_unwind/emcc.rs b/src/libpanic_unwind/emcc.rs
index b3ab1117674..0e48e37c923 100644
--- a/src/libpanic_unwind/emcc.rs
+++ b/src/libpanic_unwind/emcc.rs
@@ -57,13 +57,10 @@ unsafe extern "C" fn rust_eh_personality(version: c_int,
                                          exception_object: *mut uw::_Unwind_Exception,
                                          context: *mut uw::_Unwind_Context)
                                          -> uw::_Unwind_Reason_Code {
-    __gxx_personality_v0(version, actions,
-                         exception_class,
-                         exception_object,
-                         context)
+    __gxx_personality_v0(version, actions, exception_class, exception_object, context)
 }
 
-extern {
+extern "C" {
     fn __cxa_allocate_exception(thrown_size: libc::size_t) -> *mut libc::c_void;
     fn __cxa_free_exception(thrown_exception: *mut libc::c_void);
     fn __cxa_throw(thrown_exception: *mut libc::c_void,
diff --git a/src/libpanic_unwind/gcc.rs b/src/libpanic_unwind/gcc.rs
index b0e05ff2058..f0f19be3366 100644
--- a/src/libpanic_unwind/gcc.rs
+++ b/src/libpanic_unwind/gcc.rs
@@ -156,14 +156,16 @@ unsafe extern "C" fn rust_eh_personality(version: c_int,
     let eh_action = find_eh_action(context);
     if actions as i32 & uw::_UA_SEARCH_PHASE as i32 != 0 {
         match eh_action {
-            EHAction::None | EHAction::Cleanup(_) => return uw::_URC_CONTINUE_UNWIND,
+            EHAction::None |
+            EHAction::Cleanup(_) => return uw::_URC_CONTINUE_UNWIND,
             EHAction::Catch(_) => return uw::_URC_HANDLER_FOUND,
             EHAction::Terminate => return uw::_URC_FATAL_PHASE1_ERROR,
         }
     } else {
         match eh_action {
             EHAction::None => return uw::_URC_CONTINUE_UNWIND,
-            EHAction::Cleanup(lpad) | EHAction::Catch(lpad) => {
+            EHAction::Cleanup(lpad) |
+            EHAction::Catch(lpad) => {
                 uw::_Unwind_SetGR(context, UNWIND_DATA_REG.0, exception_object as uintptr_t);
                 uw::_Unwind_SetGR(context, UNWIND_DATA_REG.1, 0);
                 uw::_Unwind_SetIP(context, lpad);
@@ -182,7 +184,7 @@ unsafe extern "C" fn rust_eh_personality(version: c_int,
 unsafe extern "C" fn rust_eh_personality(state: uw::_Unwind_State,
                                          exception_object: *mut uw::_Unwind_Exception,
                                          context: *mut uw::_Unwind_Context)
-                                        -> uw::_Unwind_Reason_Code {
+                                         -> uw::_Unwind_Reason_Code {
     let state = state as c_int;
     let action = state & uw::_US_ACTION_MASK as c_int;
     let search_phase = if action == uw::_US_VIRTUAL_UNWIND_FRAME as c_int {
@@ -191,7 +193,7 @@ unsafe extern "C" fn rust_eh_personality(state: uw::_Unwind_State,
         // we want to continue unwinding the stack, otherwise all our backtraces
         // would end at __rust_try
         if state & uw::_US_FORCE_UNWIND as c_int != 0 {
-            return continue_unwind(exception_object, context)
+            return continue_unwind(exception_object, context);
         }
         true
     } else if action == uw::_US_UNWIND_FRAME_STARTING as c_int {
@@ -207,7 +209,9 @@ unsafe extern "C" fn rust_eh_personality(state: uw::_Unwind_State,
     // To preserve signatures of functions like _Unwind_GetLanguageSpecificData(), which
     // take only the context pointer, GCC personality routines stash a pointer to exception_object
     // in the context, using location reserved for ARM's "scratch register" (r12).
-    uw::_Unwind_SetGR(context, uw::UNWIND_POINTER_REG, exception_object as uw::_Unwind_Ptr);
+    uw::_Unwind_SetGR(context,
+                      uw::UNWIND_POINTER_REG,
+                      exception_object as uw::_Unwind_Ptr);
     // ...A more principled approach would be to provide the full definition of ARM's
     // _Unwind_Context in our libunwind bindings and fetch the required data from there directly,
     // bypassing DWARF compatibility functions.
@@ -223,7 +227,8 @@ unsafe extern "C" fn rust_eh_personality(state: uw::_Unwind_State,
     } else {
         match eh_action {
             EHAction::None => return continue_unwind(exception_object, context),
-            EHAction::Cleanup(lpad) | EHAction::Catch(lpad) => {
+            EHAction::Cleanup(lpad) |
+            EHAction::Catch(lpad) => {
                 uw::_Unwind_SetGR(context, UNWIND_DATA_REG.0, exception_object as uintptr_t);
                 uw::_Unwind_SetGR(context, UNWIND_DATA_REG.1, 0);
                 uw::_Unwind_SetIP(context, lpad);
@@ -247,8 +252,8 @@ unsafe extern "C" fn rust_eh_personality(state: uw::_Unwind_State,
     // defined in libgcc
     extern "C" {
         fn __gnu_unwind_frame(exception_object: *mut uw::_Unwind_Exception,
-                                context: *mut uw::_Unwind_Context)
-                                -> uw::_Unwind_Reason_Code;
+                              context: *mut uw::_Unwind_Context)
+                              -> uw::_Unwind_Reason_Code;
     }
 }
 
diff --git a/src/libpanic_unwind/seh64_gnu.rs b/src/libpanic_unwind/seh64_gnu.rs
index e6d3920b29c..d4906b556b3 100644
--- a/src/libpanic_unwind/seh64_gnu.rs
+++ b/src/libpanic_unwind/seh64_gnu.rs
@@ -129,7 +129,8 @@ unsafe fn find_landing_pad(dc: &c::DISPATCHER_CONTEXT) -> Option<usize> {
     };
     match find_eh_action(dc.HandlerData, &eh_ctx) {
         EHAction::None => None,
-        EHAction::Cleanup(lpad) | EHAction::Catch(lpad) => Some(lpad),
+        EHAction::Cleanup(lpad) |
+        EHAction::Catch(lpad) => Some(lpad),
         EHAction::Terminate => intrinsics::abort(),
     }
 }