dotnet / LLVMSharp

LLVM bindings for .NET Standard written in C# using ClangSharp
MIT License
844 stars 97 forks source link

Add HelloWorld sample of LLVMSharp15 #206

Closed CWKSC closed 1 year ago

CWKSC commented 1 year ago

This HelloWorld sample will output:

[Output of LLVM IR]:

; ModuleID = 'Hello World'
source_filename = "Hello World"

@0 = private unnamed_addr constant [13 x i8] c"Hello World!\00", align 1

declare i32 @puts(ptr %0)

define i32 @main() {
entry:
    %0 = call i32 @puts(ptr @0)
    ret i32 0
}

[Output of JIT Compiler]:

Hello World!
tannergooding commented 1 year ago

Sorry for the delay in getting this reviewed, was working through some infrastructure issues and upgrading to a new code signing client.