-
Notifications
You must be signed in to change notification settings - Fork 57
Update README #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update README #80
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks amazing!
README.md
Outdated
let builder = IRBuilder(module: module) | ||
|
||
let main = builder.addFunction( | ||
name: "main", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tabs -> spaces
README.md
Outdated
let main = builder.addFunction( | ||
name: "main", | ||
type: FunctionType(argTypes: [], | ||
returnType: VoidType()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stray tab
README.md
Outdated
Notice that the value of `retVal` depends on the path the flow of control takes through this program, so we must emit a Phi node to properly initialize it: | ||
|
||
```swift | ||
let function = builder.addFunction("calculateFibs", type: FunctionType(argTypes: [IntType.int1], returnType: FloatType.double)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's align these parameters
README.md
Outdated
Notice that the value of `retVal` depends on the path the flow of control takes through this program, so we must emit a Phi node to properly initialize it: | ||
|
||
```swift | ||
let function = builder.addFunction("calculateFibs", type: FunctionType(argTypes: [IntType.int1], returnType: FloatType.double)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we explain that booleans are int1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did want to add a section on types originally. I'll see what I can do.
|
||
```swift | ||
// Setup the JIT | ||
let jit = try! JIT(module: module, machine: TargetMachine()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure the machine is defaulted, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not.
Looks amazing modulo nitpicks! |
README.md
Outdated
Notice that the value of `retVal` depends on the path the flow of control takes through this program, so we must emit a PHI node to properly initialize it: | ||
|
||
```swift | ||
let function = builder.addFunction("calculateFibs", type: FunctionType(argTypes: [IntType.int1], returnType: FloatType.double)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still maybe align these parameters?
53e7662
to
ff34558
Compare
New section on types |
🚢 🇮🇹 |
⛵️ |
No description provided.