Merge pull request #354 from Niki4tap/master
Added a package to support LLVM IR
This commit is contained in:
commit
2ae63a4d69
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
curl -L "https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz" -o llvm-ir.tar.xz
|
||||
|
||||
tar xf llvm-ir.tar.xz clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu-/bin --strip-components=1
|
||||
|
||||
rm llvm-ir.tar.xz
|
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
llc "$@" -o binary.s
|
||||
clang binary.s -o binary
|
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
export PATH=$PWD/bin:$PATH
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"language": "llvm_ir",
|
||||
"version": "12.0.1",
|
||||
"aliases": ["llvm", "llvm-ir", "ll"]
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
shift
|
||||
binary "$@"
|
|
@ -0,0 +1,10 @@
|
|||
@.str = private unnamed_addr constant [2 x i8] c"OK"
|
||||
|
||||
declare i32 @puts(i8* nocapture) nounwind
|
||||
|
||||
define i32 @main() {
|
||||
%cast210 = getelementptr [2 x i8],[2 x i8]* @.str, i64 0, i64 0
|
||||
|
||||
call i32 @puts(i8* %cast210)
|
||||
ret i32 0
|
||||
}
|
Loading…
Reference in New Issue