Skip to content

Instantly share code, notes, and snippets.

@glandium
Created March 23, 2018 22:12
Show Gist options
  • Save glandium/a73d38ae357154b194ec5eb9a4354730 to your computer and use it in GitHub Desktop.
Save glandium/a73d38ae357154b194ec5eb9a4354730 to your computer and use it in GitHub Desktop.
; ModuleID = 'test0-8787f43e282added376259c1adb08b80.rs'
source_filename = "test0-8787f43e282added376259c1adb08b80.rs"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%str_slice = type { i8*, i64 }
%"unwind::libunwind::_Unwind_Exception" = type { i64, [0 x i8], void (i32, %"unwind::libunwind::_Unwind_Exception"*)*, [0 x i8], [6 x i64], [0 x i8] }
%"unwind::libunwind::_Unwind_Context" = type {}
@str.0 = internal constant [43 x i8] c"called `Option::unwrap()` on a `None` value"
@str.1 = internal constant [31 x i8] c"/checkout/src/libcore/option.rs"
@ref.2 = internal unnamed_addr constant { %str_slice, %str_slice, i32, i32 } { %str_slice { i8* getelementptr inbounds ([43 x i8], [43 x i8]* @str.0, i32 0, i32 0), i64 43 }, %str_slice { i8* getelementptr inbounds ([31 x i8], [31 x i8]* @str.1, i32 0, i32 0), i64 31 }, i32 335, i32 20 }, align 8
@_ZN4test5FUNCS17h4349eb3b1be595e8E = local_unnamed_addr constant { i8*, i8*, i8* } zeroinitializer, align 8
; test::malloc
; Function Attrs: noreturn nounwind uwtable
define noalias nonnull i8* @_ZN4test6malloc17h1ac0f4f12abdfc94E(i64 %size) unnamed_addr #0 personality i32 (i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality {
start:
; call core::panicking::panic
tail call void @_ZN4core9panicking5panic17h38c589f1508f29c1E({ %str_slice, [0 x i8], %str_slice, [0 x i8], i32, [0 x i8], i32, [0 x i8] }* noalias readonly dereferenceable(40) bitcast ({ %str_slice, %str_slice, i32, i32 }* @ref.2 to { %str_slice, [0 x i8], %str_slice, [0 x i8], i32, [0 x i8], i32, [0 x i8] }*)) #4
unreachable
}
; test::calloc
; Function Attrs: noreturn nounwind uwtable
define noalias nonnull i8* @_ZN4test6calloc17h834bd54353e19d59E(i64 %nmemb, i64 %size) unnamed_addr #0 personality i32 (i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality {
start:
; call core::panicking::panic
tail call void @_ZN4core9panicking5panic17h38c589f1508f29c1E({ %str_slice, [0 x i8], %str_slice, [0 x i8], i32, [0 x i8], i32, [0 x i8] }* noalias readonly dereferenceable(40) bitcast ({ %str_slice, %str_slice, i32, i32 }* @ref.2 to { %str_slice, [0 x i8], %str_slice, [0 x i8], i32, [0 x i8], i32, [0 x i8] }*)) #4
unreachable
}
; test::realloc
; Function Attrs: noreturn nounwind uwtable
define noalias nonnull i8* @_ZN4test7realloc17h26a440b34cb9362fE(i8* nocapture readnone %ptr, i64 %size) unnamed_addr #0 personality i32 (i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality {
start:
; call core::panicking::panic
tail call void @_ZN4core9panicking5panic17h38c589f1508f29c1E({ %str_slice, [0 x i8], %str_slice, [0 x i8], i32, [0 x i8], i32, [0 x i8] }* noalias readonly dereferenceable(40) bitcast ({ %str_slice, %str_slice, i32, i32 }* @ref.2 to { %str_slice, [0 x i8], %str_slice, [0 x i8], i32, [0 x i8], i32, [0 x i8] }*)) #4
unreachable
}
; test::to_color_fast
; Function Attrs: uwtable
define i8 @_ZN4test13to_color_fast17h3bc480d5790ee056E(i64 %c) unnamed_addr #1 {
start:
%0 = trunc i64 %c to i8
%1 = and i8 %0, 1
ret i8 %1
}
; test::to_color
; Function Attrs: uwtable
define i8 @_ZN4test8to_color17ha8d9e7270592c8cdE(i64 %c) unnamed_addr #1 personality i32 (i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality {
start:
%0 = trunc i64 %c to i8
%abi_cast.sroa.4.0.extract.trunc.i = and i8 %0, 1
ret i8 %abi_cast.sroa.4.0.extract.trunc.i
}
declare i32 @rust_eh_personality(i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*) unnamed_addr #2
; core::panicking::panic
; Function Attrs: cold noinline noreturn
declare void @_ZN4core9panicking5panic17h38c589f1508f29c1E({ %str_slice, [0 x i8], %str_slice, [0 x i8], i32, [0 x i8], i32, [0 x i8] }* noalias readonly dereferenceable(40)) unnamed_addr #3
attributes #0 = { noreturn nounwind uwtable "probe-stack"="__rust_probestack" }
attributes #1 = { uwtable "probe-stack"="__rust_probestack" }
attributes #2 = { "probe-stack"="__rust_probestack" }
attributes #3 = { cold noinline noreturn "probe-stack"="__rust_probestack" }
attributes #4 = { nounwind }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment