如何将.ll文件转换为没有LLC的对象,还是可以将LLC与C家族中的语言不使用LLC?
我已经为一种具有自定义扩展的语言的编译器构建了无聊的语言。目前这是非常简单的,但是要继续我要使用LLC将我的LLVM生成的.ll文件转换为对象,然后使用GCC将其转换为可执行文件。但是,当我想首先使用该LLC转换时,我的问题出现了,因为我很难构建LLVM的开发式构建,并且目前在窗户上。我研究了其他选择,但它们似乎都没有正常运行。几个小时的时间将我的头撞到墙上,这么简单,所以我在这里。我一直在寻找可以使我做的东西。
这是目前.ll文件的内容。
; ModuleID = "C:\Users\<mynamelol>\Documents\GitHub\sollux\codegen.py"
target triple = "x86_64-pc-windows-msvc"
target datalayout = ""
define void @"main"()
{
entry:
%".2" = sub i8 4, 2
%".3" = add i8 4, %".2"
%".4" = bitcast [5 x i8]* @"fstr" to i8*
%".5" = call i32 (i8*, ...) @"printf"(i8* %".4", i8 %".3")
ret void
}
declare i32 @"printf"(i8* %".1", ...)
@"fstr" = internal constant [5 x i8] c"%i \0a\00"
链接 file ,因为...为什么...为什么不大声笑。要安抚stackoverflow回答神。
如果有任何方法可以将LLC与LLVM一起使用,而在我的困境中也完全可以!一切都会有所帮助,谢谢您的宝贵时间,对不起,今晚我有点愚蠢。
I've built my own compiler for a language with a custom extension, out of boredom. It's very bare-bones at the moment, but to proceed I want to use LLC to convert the .ll file generated by my LLVM into an object, and then use GCC to turn that into an executable file. However, my issue comes up when I want to first use that LLC conversion, as I've had trouble building a dev build of LLVM and am currently on a Windows. I've looked into alternative options but none of them seemed to properly function; it's been a few hours of hitting my head against the wall for something so simple, so here I am. I've been looking for something that allows me to make that .ll an object, and then I can continue on my merry way and put it through GCC.
Here is the content of the .ll file at the moment.
; ModuleID = "C:\Users\<mynamelol>\Documents\GitHub\sollux\codegen.py"
target triple = "x86_64-pc-windows-msvc"
target datalayout = ""
define void @"main"()
{
entry:
%".2" = sub i8 4, 2
%".3" = add i8 4, %".2"
%".4" = bitcast [5 x i8]* @"fstr" to i8*
%".5" = call i32 (i8*, ...) @"printf"(i8* %".4", i8 %".3")
ret void
}
declare i32 @"printf"(i8* %".1", ...)
@"fstr" = internal constant [5 x i8] c"%i \0a\00"
And a link to the file, because... why not lol. Gotta appease the StackOverflow answer gods.
If there's any way to use LLC with LLVM while stuck in my predicament that's totally okay as well! Anything helps, thank you for your time, sorry that I'm a little dumb tonight.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论