Error[8]: Undefined offset: 2, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述我是LLVM的新手,并试图在 Linux上生成一个人类可读的.ll文件.我安装了llvm-gcc但是我看到它只能生成汇编代码(-S选项).有什么方法可以获得llvm online compiler生成的内容吗? 这就是我在Linux上使用-S -emit-llvm所得到的: .file "hello.c" .ident "GCC: (Ubuntu/Linaro 4.5.1-7ubu 我是LLVM的新手,并试图在 Linux上生成一个人类可读的.ll文件.我安装了llvm-gcc但是我看到它只能生成汇编代码(-S选项).有什么方法可以获得llvm online compiler生成的内容吗?

这就是我在linux上使用-S -emit-llvm所得到的:

.file   "hello.c"    .IDent  "GCC: (Ubuntu/linaro 4.5.1-7ubuntu2) 4.5.1 LLVM: "    .text    .globl  main    .align  16,0x90    .type   main,@functionmain:    pushl   %ebp    movl    %esp,%ebp    subl    ,%esp    movl    $.L.str,4(%esp)    movl    ,(%esp)    call    __printf_chk    xorl    %eax,%eax    addl    ,%esp    popl    %ebp    ret.Ltmp0:    .size   main,.Ltmp0-main    .type   .L.str,@object    .section    .rodata.str1.1,"aMS",@progbits,1.L.str:    .asciz   "hello world\n"    .size   .L.str,13    .section    .note.GNU-stack,"",@progbits

这就是我想要得到的:

; ModuleID = '/tmp/webcompile/_7829_0.bc'target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"target triple = "x86_64-linux-gnu"@.str = private constant [12 x i8] c"hello world[+++]",align 1 ; <[12 x i8]*> [#uses=1]define i32 @main() nounwind {entry:  %0 = tail call i32 @puts(i8* getelementptr inbounds ([12 x i8]* @.str,i64 0,i64 0)) nounwind ; <i32> [#uses=0]  ret i32 0}declare i32 @puts(i8* nocapture) nounwind

在windows上,我使用相同的命令成功获取此文件:llvm-gcc -S -emit-llvm hello.c.

解决方法 在llvm-gcc的ubuntu包装中有些东西可怕破碎. llvm-gcc的版本是4.2.1,但在这里我们看到4.5.请报告Ubuntu错误. 总结

以上是内存溢出为你收集整理的-emit-llvm在Linux中全部内容,希望文章能够帮你解决-emit-llvm在Linux中所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
-emit-llvm在Linux中_系统运维_内存溢出

-emit-llvm在Linux中

-emit-llvm在Linux中,第1张

概述我是LLVM的新手,并试图在 Linux上生成一个人类可读的.ll文件.我安装了llvm-gcc但是我看到它只能生成汇编代码(-S选项).有什么方法可以获得llvm online compiler生成的内容吗? 这就是我在Linux上使用-S -emit-llvm所得到的: .file "hello.c" .ident "GCC: (Ubuntu/Linaro 4.5.1-7ubu 我是LLVM的新手,并试图在 Linux上生成一个人类可读的.ll文件.我安装了llvm-gcc但是我看到它只能生成汇编代码(-S选项).有什么方法可以获得llvm online compiler生成的内容吗?

这就是我在linux上使用-S -emit-llvm所得到的:

.file   "hello.c"    .IDent  "GCC: (Ubuntu/linaro 4.5.1-7ubuntu2) 4.5.1 LLVM: "    .text    .globl  main    .align  16,0x90    .type   main,@functionmain:    pushl   %ebp    movl    %esp,%ebp    subl    ,%esp    movl    $.L.str,4(%esp)    movl    ,(%esp)    call    __printf_chk    xorl    %eax,%eax    addl    ,%esp    popl    %ebp    ret.Ltmp0:    .size   main,.Ltmp0-main    .type   .L.str,@object    .section    .rodata.str1.1,"aMS",@progbits,1.L.str:    .asciz   "hello world\n"    .size   .L.str,13    .section    .note.GNU-stack,"",@progbits

这就是我想要得到的:

; ModuleID = '/tmp/webcompile/_7829_0.bc'target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"target triple = "x86_64-linux-gnu"@.str = private constant [12 x i8] c"hello world",align 1 ; <[12 x i8]*> [#uses=1]define i32 @main() nounwind {entry:  %0 = tail call i32 @puts(i8* getelementptr inbounds ([12 x i8]* @.str,i64 0,i64 0)) nounwind ; <i32> [#uses=0]  ret i32 0}declare i32 @puts(i8* nocapture) nounwind

在windows上,我使用相同的命令成功获取此文件:llvm-gcc -S -emit-llvm hello.c.

解决方法 在llvm-gcc的ubuntu包装中有些东西可怕破碎. llvm-gcc的版本是4.2.1,但在这里我们看到4.5.请报告Ubuntu错误. 总结

以上是内存溢出为你收集整理的-emit-llvm在Linux中全部内容,希望文章能够帮你解决-emit-llvm在Linux中所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1047642.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存