File tree Expand file tree Collapse file tree 2 files changed +8
-16
lines changed Expand file tree Collapse file tree 2 files changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -370,21 +370,6 @@ pub(crate) fn llfn_attrs_from_instance<'ll, 'tcx>(
370
370
} ;
371
371
to_add. extend ( inline_attr ( cx, inline) ) ;
372
372
373
- // The `uwtable` attribute according to LLVM is:
374
- //
375
- // This attribute indicates that the ABI being targeted requires that an
376
- // unwind table entry be produced for this function even if we can show
377
- // that no exceptions passes by it. This is normally the case for the
378
- // ELF x86-64 abi, but it can be disabled for some compilation units.
379
- //
380
- // Typically when we're compiling with `-C panic=abort` we don't need
381
- // `uwtable` because we can't generate any exceptions! On Windows, however,
382
- // exceptions include other events such as illegal instructions, segfaults,
383
- // etc. This means that on Windows we end up still needing the `uwtable`
384
- // attribute even if the `-C panic=abort` flag is passed.
385
- //
386
- // You can also find more info on why Windows always requires uwtables here:
387
- // https://bugzilla.mozilla.org/show_bug.cgi?id=1302078
388
373
if cx. sess ( ) . must_emit_unwind_tables ( ) {
389
374
to_add. push ( uwtable_attr ( cx. llcx , cx. sess ( ) . opts . unstable_opts . use_sync_unwind ) ) ;
390
375
}
Original file line number Diff line number Diff line change @@ -776,8 +776,15 @@ impl Session {
776
776
777
777
pub fn must_emit_unwind_tables ( & self ) -> bool {
778
778
// This is used to control the emission of the `uwtable` attribute on
779
- // LLVM functions.
779
+ // LLVM functions. The `uwtable` attribute according to LLVM is:
780
780
//
781
+ // This attribute indicates that the ABI being targeted requires that an
782
+ // unwind table entry be produced for this function even if we can show
783
+ // that no exceptions passes by it. This is normally the case for the
784
+ // ELF x86-64 abi, but it can be disabled for some compilation units.
785
+ //
786
+ // Typically when we're compiling with `-C panic=abort` we don't need
787
+ // `uwtable` because we can't generate any exceptions!
781
788
// Unwind tables are needed when compiling with `-C panic=unwind`, but
782
789
// LLVM won't omit unwind tables unless the function is also marked as
783
790
// `nounwind`, so users are allowed to disable `uwtable` emission.
You can’t perform that action at this time.
0 commit comments