Skip to content

Instantly share code, notes, and snippets.

@glandium
Created March 23, 2018 22:14
Show Gist options
  • Save glandium/7f0212770208d3a4105a7e275a10df2d to your computer and use it in GitHub Desktop.
Save glandium/7f0212770208d3a4105a7e275a10df2d 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"
%"unwind::libunwind::_Unwind_Exception" = type { [0 x i8], i64, [0 x i8], void (i32, %"unwind::libunwind::_Unwind_Exception"*)*, [0 x i8], [6 x i64], [0 x i8] }
%"unwind::libunwind::_Unwind_Context" = type { [0 x i8] }
@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 { [0 x i8], { [0 x i8]*, i64 }, [0 x i8], { [0 x i8]*, i64 }, [0 x i8], i32, [0 x i8], i32, [0 x i8] } { [0 x i8] undef, { [0 x i8]*, i64 } { [0 x i8]* bitcast ([43 x i8]* @str.0 to [0 x i8]*), i64 43 }, [0 x i8] undef, { [0 x i8]*, i64 } { [0 x i8]* bitcast ([31 x i8]* @str.1 to [0 x i8]*), i64 31 }, [0 x i8] undef, i32 335, [0 x i8] undef, i32 20, [0 x i8] undef }, align 8
@_ZN4test5FUNCS17h4349eb3b1be595e8E = local_unnamed_addr constant { [0 x i8], {}*, [0 x i8], {}*, [0 x i8], {}*, [0 x i8] } { [0 x i8] undef, {}* null, [0 x i8] undef, {}* null, [0 x i8] undef, {}* null, [0 x i8] undef }, align 8
; test::malloc
; Function Attrs: nounwind uwtable
define i8* @_ZN4test6malloc17h1ac0f4f12abdfc94E(i64 %size) unnamed_addr #0 personality i32 (i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality {
start:
%0 = load i8*, i8** bitcast ({ [0 x i8], {}*, [0 x i8], {}*, [0 x i8], {}*, [0 x i8] }* @_ZN4test5FUNCS17h4349eb3b1be595e8E to i8**), align 8
%1 = icmp eq i8* %0, null
br i1 %1, label %bb1.i, label %"_ZN38_$LT$core..option..Option$LT$T$GT$$GT$6unwrap17h9b77f08e668ab516E.exit"
bb1.i: ; preds = %start
; call core::panicking::panic
tail call void @_ZN4core9panicking5panic17ha63c40e505bfbf8eE({ [0 x i8], { [0 x i8]*, i64 }, [0 x i8], { [0 x i8]*, i64 }, [0 x i8], i32, [0 x i8], i32, [0 x i8] }* noalias nonnull readonly dereferenceable(40) @ref.2) #4
unreachable
"_ZN38_$LT$core..option..Option$LT$T$GT$$GT$6unwrap17h9b77f08e668ab516E.exit": ; preds = %start
%2 = bitcast i8* %0 to i8* (i64)*
%3 = tail call i8* %2(i64 %size) #4
ret i8* %3
}
; test::calloc
; Function Attrs: nounwind uwtable
define 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 @_ZN4core9panicking5panic17ha63c40e505bfbf8eE({ [0 x i8], { [0 x i8]*, i64 }, [0 x i8], { [0 x i8]*, i64 }, [0 x i8], i32, [0 x i8], i32, [0 x i8] }* noalias nonnull readonly dereferenceable(40) @ref.2) #4
unreachable
}
; test::realloc
; Function Attrs: nounwind uwtable
define i8* @_ZN4test7realloc17h26a440b34cb9362fE(i8* %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 @_ZN4core9panicking5panic17ha63c40e505bfbf8eE({ [0 x i8], { [0 x i8]*, i64 }, [0 x i8], { [0 x i8]*, i64 }, [0 x i8], i32, [0 x i8], i32, [0 x i8] }* noalias nonnull readonly dereferenceable(40) @ref.2) #4
unreachable
}
; test::to_color_fast
; Function Attrs: uwtable
define zeroext i1 @_ZN4test13to_color_fast17h3bc480d5790ee056E(i64 %c) unnamed_addr #1 {
start:
%0 = and i64 %c, 1
%not.switch = icmp ne i64 %0, 0
ret i1 %not.switch
}
; test::to_color
; Function Attrs: uwtable
define zeroext i1 @_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 = and i64 %c, 1
%1 = trunc i64 %0 to i8
%2 = sub nsw i8 2, %1
%switch.selectcmp1.i = icmp eq i64 %0, 0
%switch.select2.i = select i1 %switch.selectcmp1.i, i8 0, i8 %2
%3 = icmp eq i8 %switch.select2.i, 2
br i1 %3, label %bb1.i, label %"_ZN38_$LT$core..option..Option$LT$T$GT$$GT$6unwrap17h00883e6f2d2f8ce7E.exit"
bb1.i: ; preds = %start
; call core::panicking::panic
tail call void @_ZN4core9panicking5panic17ha63c40e505bfbf8eE({ [0 x i8], { [0 x i8]*, i64 }, [0 x i8], { [0 x i8]*, i64 }, [0 x i8], i32, [0 x i8], i32, [0 x i8] }* noalias nonnull readonly dereferenceable(40) @ref.2)
unreachable
"_ZN38_$LT$core..option..Option$LT$T$GT$$GT$6unwrap17h00883e6f2d2f8ce7E.exit": ; preds = %start
%4 = and i8 %switch.select2.i, 1
%5 = icmp ne i8 %4, 0
ret i1 %5
}
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 @_ZN4core9panicking5panic17ha63c40e505bfbf8eE({ [0 x i8], { [0 x i8]*, i64 }, [0 x i8], { [0 x i8]*, i64 }, [0 x i8], i32, [0 x i8], i32, [0 x i8] }* noalias readonly dereferenceable(40)) unnamed_addr #3
attributes #0 = { 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