-
-
Save KokaKiwi/b33f7526185f823fc99a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rustc --opt-level=2 --crate-type lib --emit ir -o main.ll main.rs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; ModuleID = 'main.0.rs' | |
target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128" | |
target triple = "x86_64-unknown-linux-gnu" | |
%"struct.collections::string::String[#6]" = type { %"struct.collections::vec::Vec<[u8]>[#6]" } | |
%"struct.collections::vec::Vec<[u8]>[#6]" = type { i8*, i64, i64 } | |
; Function Attrs: uwtable | |
define void @_ZN6create20hc59f23293699ff60eaaE(%"struct.collections::string::String[#6]"* noalias nocapture sret dereferenceable(24)) unnamed_addr #0 { | |
for_body.i.preheader.i.i.i: | |
%1 = tail call i8* @je_mallocx(i64 11, i32 0), !noalias !0 | |
store i8 104, i8* %1, align 1, !noalias !12 | |
%2 = getelementptr inbounds i8* %1, i64 1 | |
store i8 101, i8* %2, align 1, !noalias !12 | |
%3 = getelementptr inbounds i8* %1, i64 2 | |
store i8 108, i8* %3, align 1, !noalias !12 | |
%4 = getelementptr inbounds i8* %1, i64 3 | |
store i8 108, i8* %4, align 1, !noalias !12 | |
%5 = getelementptr inbounds i8* %1, i64 4 | |
store i8 111, i8* %5, align 1, !noalias !12 | |
%6 = getelementptr inbounds i8* %1, i64 5 | |
store i8 32, i8* %6, align 1, !noalias !12 | |
%7 = getelementptr inbounds i8* %1, i64 6 | |
store i8 119, i8* %7, align 1, !noalias !12 | |
%8 = getelementptr inbounds i8* %1, i64 7 | |
store i8 111, i8* %8, align 1, !noalias !12 | |
%9 = getelementptr inbounds i8* %1, i64 8 | |
store i8 114, i8* %9, align 1, !noalias !12 | |
%10 = getelementptr inbounds i8* %1, i64 9 | |
store i8 108, i8* %10, align 1, !noalias !12 | |
%11 = getelementptr inbounds i8* %1, i64 10 | |
store i8 100, i8* %11, align 1, !noalias !12 | |
%vector.sroa.0.0..sroa_idx.i.i.i = getelementptr inbounds %"struct.collections::string::String[#6]"* %0, i64 0, i32 0, i32 0 | |
store i8* %1, i8** %vector.sroa.0.0..sroa_idx.i.i.i, align 8, !alias.scope !16, !noalias !17 | |
%vector.sroa.14.0..sroa_idx26.i.i.i = getelementptr inbounds %"struct.collections::string::String[#6]"* %0, i64 0, i32 0, i32 1 | |
store i64 11, i64* %vector.sroa.14.0..sroa_idx26.i.i.i, align 8, !alias.scope !16, !noalias !17 | |
%vector.sroa.18.0..sroa_idx29.i.i.i = getelementptr inbounds %"struct.collections::string::String[#6]"* %0, i64 0, i32 0, i32 2 | |
store i64 11, i64* %vector.sroa.18.0..sroa_idx29.i.i.i, align 8, !alias.scope !16, !noalias !17 | |
ret void | |
} | |
declare i8* @je_mallocx(i64, i32) unnamed_addr #1 | |
attributes #0 = { uwtable "split-stack" } | |
attributes #1 = { "split-stack" } | |
!0 = metadata !{metadata !1, metadata !3, metadata !5, metadata !6, metadata !8, metadata !9, metadata !11} | |
!1 = metadata !{metadata !1, metadata !2, metadata !"_ZN3vec12Vec$LT$T$GT$13with_capacity20h7577694137728200894E: argument 0"} | |
!2 = metadata !{metadata !2, metadata !"_ZN3vec12Vec$LT$T$GT$13with_capacity20h7577694137728200894E"} | |
!3 = metadata !{metadata !3, metadata !4, metadata !"_ZN5slice42_$x5bT$x5d.CloneSliceAllocPrelude$LT$T$GT$6to_vec19h985762045282842730E: argument 0"} | |
!4 = metadata !{metadata !4, metadata !"_ZN5slice42_$x5bT$x5d.CloneSliceAllocPrelude$LT$T$GT$6to_vec19h985762045282842730E"} | |
!5 = metadata !{metadata !5, metadata !4, metadata !"_ZN5slice42_$x5bT$x5d.CloneSliceAllocPrelude$LT$T$GT$6to_vec19h985762045282842730E: argument 1"} | |
!6 = metadata !{metadata !6, metadata !7, metadata !"_ZN6string6String8from_str20h003cb16642c399c8LZiE: argument 0"} | |
!7 = metadata !{metadata !7, metadata !"_ZN6string6String8from_str20h003cb16642c399c8LZiE"} | |
!8 = metadata !{metadata !8, metadata !7, metadata !"_ZN6string6String8from_str20h003cb16642c399c8LZiE: argument 1"} | |
!9 = metadata !{metadata !9, metadata !10, metadata !"_ZN3str31_$BP$$x27a$x20str.StrAllocating11into_string20ha185257b72afb9ebkSiE: argument 0"} | |
!10 = metadata !{metadata !10, metadata !"_ZN3str31_$BP$$x27a$x20str.StrAllocating11into_string20ha185257b72afb9ebkSiE"} | |
!11 = metadata !{metadata !11, metadata !10, metadata !"_ZN3str31_$BP$$x27a$x20str.StrAllocating11into_string20ha185257b72afb9ebkSiE: argument 1"} | |
!12 = metadata !{metadata !13, metadata !15, metadata !3, metadata !5, metadata !6, metadata !8, metadata !9, metadata !11} | |
!13 = metadata !{metadata !13, metadata !14, metadata !"_ZN3vec12Vec$LT$T$GT$8push_all20h1554414417117437021E: argument 0"} | |
!14 = metadata !{metadata !14, metadata !"_ZN3vec12Vec$LT$T$GT$8push_all20h1554414417117437021E"} | |
!15 = metadata !{metadata !15, metadata !14, metadata !"_ZN3vec12Vec$LT$T$GT$8push_all20h1554414417117437021E: argument 1"} | |
!16 = metadata !{metadata !3, metadata !6, metadata !9} | |
!17 = metadata !{metadata !5, metadata !8, metadata !11} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn create() -> String { | |
"hello world".into_string() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rustc --version=verbose | |
rustc 0.13.0-nightly (395901393 2014-11-24 00:46:30 +0000) | |
binary: rustc | |
commit-hash: 395901393c369c910a8ae36ace71402cb206d217 | |
commit-date: 2014-11-24 00:46:30 +0000 | |
host: x86_64-unknown-linux-gnu | |
release: 0.13.0-nightly |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment