मैं एलएलवीएम के लिए नौसिखिया हूं और लिनक्स पर एक मानव पठनीय .ll फ़ाइल उत्पन्न करने का प्रयास करता हूं। मैंने llvm-gcc स्थापित किया लेकिन जैसा कि मैंने देखा कि यह केवल असेंबली कोड (-एस विकल्प) उत्पन्न कर सकता है। क्या llvm ऑनलाइन compiler द्वारा जेनरेट की गई चीज़ों को प्राप्त करने का कोई तरीका है?-emit-llvm लिनक्स
है यही कारण है कि मैं लिनक्स पर -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,@function
main:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
movl $.L.str, 4(%esp)
movl $1, (%esp)
call __printf_chk
xorl %eax, %eax
addl $8, %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
है यही कारण है कि मैं पाने के लिए कोशिश कर रहा हूँ: llvm-gcc -S -emit-llvm hello.c
:
; 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\00", 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
खिड़कियों पर मैं सफलतापूर्वक एक ही कमांड के साथ इस फाइल को मिलता है।
-fplugin- arg-dragonegg-emit-ir – Nutel
ठीक है, llvm-gcc dragonegg नहीं है। अगर उबंटू "धोखा" करने की कोशिश कर रहा है, तो यह फिर से उबंटू बग है :) –