Skip to content

Instantly share code, notes, and snippets.

@alexcrichton
Created July 10, 2017 17:29
Show Gist options
  • Save alexcrichton/8a3923a5409108c8ada54f395bcd5b55 to your computer and use it in GitHub Desktop.
Save alexcrichton/8a3923a5409108c8ada54f395bcd5b55 to your computer and use it in GitHub Desktop.
#![crate_type = "rlib"]
pub fn bar() {}
; ModuleID = 'foo.cgu-0.rs'
source_filename = "foo.cgu-0.rs"
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-gnu"
%A = type {}
%"panic_unwind::windows::EXCEPTION_RECORD" = type { i32, [0 x i8], i32, [0 x i8], %"panic_unwind::windows::EXCEPTION_RECORD"*, [0 x i8], i8*, [0 x i8], i32, [4 x i8], [15 x i8*], [0 x i8] }
%"panic_unwind::windows::CONTEXT" = type {}
%"panic_unwind::windows::DISPATCHER_CONTEXT" = type { i8*, [0 x i8], i8*, [0 x i8], %"panic_unwind::windows::RUNTIME_FUNCTION"*, [0 x i8], i8*, [0 x i8], i8*, [0 x i8], %"panic_unwind::windows::CONTEXT"*, [0 x i8], i8*, [0 x i8], i8*, [0 x i8], %"panic_unwind::windows::UNWIND_HISTORY_TABLE"*, [0 x i8] }
%"panic_unwind::windows::RUNTIME_FUNCTION" = type { i32, [0 x i8], i32, [0 x i8], i32, [0 x i8] }
%"panic_unwind::windows::UNWIND_HISTORY_TABLE" = type {}
; <foo::A as core::ops::drop::Drop>::drop
; Function Attrs: norecurse nounwind readnone uwtable
define void @"_ZN48_$LT$foo..A$u20$as$u20$core..ops..drop..Drop$GT$4drop17hc34d32ad32722cffE"(%A* nocapture) unnamed_addr #0 {
start:
ret void
}
; foo::foo
; Function Attrs: uwtable
define void @_ZN3foo3foo17h6cb4f4601b3a0374E() unnamed_addr #1 personality i32 (%"panic_unwind::windows::EXCEPTION_RECORD"*, i8*, %"panic_unwind::windows::CONTEXT"*, %"panic_unwind::windows::DISPATCHER_CONTEXT"*)* @rust_eh_personality {
start:
; invoke bar::bar
invoke void @_ZN3bar3bar17h21868f3a4452d05bE()
to label %bb2 unwind label %cleanup
bb2: ; preds = %start
ret void
cleanup: ; preds = %start
%0 = landingpad { i8*, i32 }
cleanup
%.fca.0.extract = extractvalue { i8*, i32 } %0, 0
tail call void @rust_eh_unwind_resume(i8* %.fca.0.extract)
unreachable
}
declare i32 @rust_eh_personality(%"panic_unwind::windows::EXCEPTION_RECORD"*, i8*, %"panic_unwind::windows::CONTEXT"*, %"panic_unwind::windows::DISPATCHER_CONTEXT"*) unnamed_addr
; bar::bar
declare void @_ZN3bar3bar17h21868f3a4452d05bE() unnamed_addr
; Function Attrs: noreturn
declare void @rust_eh_unwind_resume(i8*) unnamed_addr #2
attributes #0 = { norecurse nounwind readnone uwtable }
attributes #1 = { uwtable }
attributes #2 = { noreturn }
#![crate_type = "rlib"]
extern crate bar;
struct A;
impl Drop for A {
fn drop(&mut self) {
}
}
pub fn foo() {
let _a = A;
bar::bar();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment