dotnet / LLVMSharp

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

Add HelloWorld sample of LLVMSharp16 #215

Closed CWKSC closed 6 months ago

CWKSC commented 1 year ago

Refer to https://github.com/dotnet/LLVMSharp/pull/206

I change to use type-safe extensions that already exist in the project.

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 Execution Engine]:

Hello World!
tannergooding commented 7 months ago

Sorry, I apparently missed this. I'm not sure GitHub ever surfaced that there was a PR submitted.

There looks to be a lot of merge conflicts resulting in incorrect changes. The root changes otherwise look reasonable and something that could be taken once the conflicts are resolved correctly.

CWKSC commented 6 months ago

I close it first, reopen / create a new pull request if I free