Skip to content

Commit 0d69f3f

Browse files
authored
Merge pull request #176 from giginet/fix-return-value
Modify return type of main function
2 parents 0d99110 + fa9c544 commit 0d69f3f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ let builder = IRBuilder(module: module)
2323
let main = builder.addFunction(
2424
"main",
2525
type: FunctionType(argTypes: [],
26-
returnType: VoidType())
26+
returnType: IntType.int64)
2727
)
2828
let entry = main.appendBasicBlock(named: "entry")
2929
builder.positionAtEnd(of: entry)
@@ -42,7 +42,7 @@ This simple program generates the following IR:
4242
```llvm
4343
// module.dump()
4444
45-
define void @main() {
45+
define i64 @main() {
4646
entry:
4747
ret i64 42
4848
}

0 commit comments

Comments
 (0)